home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / doc / xbradoc.zoo / xbra.tex < prev   
LaTeX Document  |  1992-01-15  |  18.6 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: LaTeX Document (document/latex).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert LaTeX Document (document/latex) magic Supported
100% dexvert Texinfo Document (document/texInfo) magic Supported
1% dexvert Corel 10 Texture (image/corel10Texture) ext Unsupported
1% dexvert Croteam texture file (image/croteamTextureFile) ext Unsupported
1% dexvert Text File (text/txt) fallback Supported
100% file LaTeX document text default
99% file TeX document text default
98% file C source, ASCII text default
100% TrID LaTeX 2e document (with rem) default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime text/x-matlab default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 25 25 20 54 68 69 73 20 | 6d 61 79 20 6c 6f 6f 6b |%% This |may look|
|00000010| 20 6c 69 6b 65 20 74 65 | 78 74 2c 20 62 75 74 20 | like te|xt, but |
|00000020| 69 74 20 69 73 20 72 65 | 61 6c 6c 79 20 2d 2a 2d |it is re|ally -*-|
|00000030| 20 4c 61 54 65 58 20 2d | 2a 2d 0a 25 0a 25 20 24 | LaTeX -|*-.%.% $|
|00000040| 52 43 53 66 69 6c 65 3a | 20 78 62 72 61 2e 74 65 |RCSfile:| xbra.te|
|00000050| 78 2c 76 20 24 0a 25 20 | 24 52 65 76 69 73 69 6f |x,v $.% |$Revisio|
|00000060| 6e 3a 20 31 2e 33 20 24 | 0a 25 20 24 41 75 74 68 |n: 1.3 $|.% $Auth|
|00000070| 6f 72 3a 20 62 61 6d 6d | 69 20 24 0a 25 0a 25 25 |or: bamm|i $.%.%%|
|00000080| 0a 5c 64 6f 63 75 6d 65 | 6e 74 73 74 79 6c 65 5b |.\docume|ntstyle[|
|00000090| 31 32 70 74 2c 66 75 6c | 6c 70 61 67 65 2c 74 69 |12pt,ful|lpage,ti|
|000000a0| 74 6c 65 70 61 67 65 5d | 7b 61 72 74 69 63 6c 65 |tlepage]|{article|
|000000b0| 7d 0a 0a 5c 74 69 74 6c | 65 7b 54 68 65 20 58 42 |}..\titl|e{The XB|
|000000c0| 52 41 20 50 72 6f 74 6f | 63 6f 6c 7d 0a 5c 61 75 |RA Proto|col}.\au|
|000000d0| 74 68 6f 72 7b 7b 5c 69 | 74 20 4a 77 61 68 61 72 |thor{{\i|t Jwahar|
|000000e0| 20 52 2e 20 42 61 6d 6d | 69 7d 20 5c 5c 20 7b 5c | R. Bamm|i} \\ {\|
|000000f0| 69 74 20 62 61 6d 6d 69 | 40 63 61 64 65 6e 63 65 |it bammi|@cadence|
|00000100| 2e 63 6f 6d 7d 7d 0a 5c | 64 61 74 65 7b 24 52 65 |.com}}.\|date{$Re|
|00000110| 76 69 73 69 6f 6e 3a 20 | 31 2e 33 20 24 7d 0a 0a |vision: |1.3 $}..|
|00000120| 5c 6e 65 77 6c 65 6e 67 | 74 68 7b 5c 69 6e 74 65 |\newleng|th{\inte|
|00000130| 72 73 6b 69 70 7d 0a 5c | 73 65 74 6c 65 6e 67 74 |rskip}.\|setlengt|
|00000140| 68 7b 5c 69 6e 74 65 72 | 73 6b 69 70 7d 7b 30 2e |h{\inter|skip}{0.|
|00000150| 35 5c 62 61 73 65 6c 69 | 6e 65 73 6b 69 70 7d 0a |5\baseli|neskip}.|
|00000160| 5c 61 64 64 74 6f 6c 65 | 6e 67 74 68 7b 5c 69 6e |\addtole|ngth{\in|
|00000170| 74 65 72 73 6b 69 70 7d | 7b 2d 2e 31 5c 69 6e 74 |terskip}|{-.1\int|
|00000180| 65 72 73 6b 69 70 7d 0a | 0a 5c 62 65 67 69 6e 7b |erskip}.|.\begin{|
|00000190| 64 6f 63 75 6d 65 6e 74 | 7d 0a 5c 6d 61 6b 65 74 |document|}.\maket|
|000001a0| 69 74 6c 65 0a 0a 5c 61 | 64 64 74 6f 6c 65 6e 67 |itle..\a|ddtoleng|
|000001b0| 74 68 7b 5c 70 61 72 73 | 6b 69 70 7d 7b 30 2e 33 |th{\pars|kip}{0.3|
|000001c0| 5c 62 61 73 65 6c 69 6e | 65 73 6b 69 70 7d 0a 5c |\baselin|eskip}.\|
|000001d0| 73 65 74 6c 65 6e 67 74 | 68 7b 5c 70 61 72 69 6e |setlengt|h{\parin|
|000001e0| 64 65 6e 74 7d 7b 30 70 | 74 7d 0a 0a 5c 73 65 63 |dent}{0p|t}..\sec|
|000001f0| 74 69 6f 6e 7b 49 6e 74 | 72 6f 64 75 63 74 69 6f |tion{Int|roductio|
|00000200| 6e 7d 0a 54 68 69 73 20 | 64 6f 63 75 6d 65 6e 74 |n}.This |document|
|00000210| 20 69 73 20 61 6e 20 61 | 74 74 65 6d 70 74 20 74 | is an a|ttempt t|
|00000220| 6f 20 73 70 65 63 69 66 | 79 20 74 68 65 20 58 42 |o specif|y the XB|
|00000230| 52 41 20 70 72 6f 74 6f | 63 6f 6c 20 66 6f 72 20 |RA proto|col for |
|00000240| 65 78 63 65 70 74 69 6f | 6e 0a 76 65 63 74 6f 72 |exceptio|n.vector|
|00000250| 20 63 68 61 69 6e 69 6e | 67 20 6f 6e 20 74 68 65 | chainin|g on the|
|00000260| 20 61 74 61 72 69 53 54 | 20 73 65 72 69 65 73 20 | atariST| series |
|00000270| 6f 66 20 63 6f 6d 70 75 | 74 65 72 73 2e 20 49 74 |of compu|ters. It|
|00000280| 20 69 73 20 61 20 72 65 | 73 70 6f 6e 73 65 0a 74 | is a re|sponse.t|
|00000290| 6f 20 6d 61 6e 79 20 72 | 65 71 75 65 73 74 73 20 |o many r|equests |
|000002a0| 49 20 68 61 76 65 20 72 | 65 63 65 69 76 65 64 20 |I have r|eceived |
|000002b0| 74 6f 20 64 6f 63 75 6d | 65 6e 74 20 74 68 65 20 |to docum|ent the |
|000002c0| 70 72 6f 74 6f 63 6f 6c | 2c 20 61 6e 64 20 61 6c |protocol|, and al|
|000002d0| 73 6f 20 61 6e 0a 65 6e | 63 6f 75 72 61 67 65 6d |so an.en|couragem|
|000002e0| 65 6e 74 20 66 6f 72 20 | 70 65 6f 70 6c 65 20 67 |ent for |people g|
|000002f0| 72 61 62 62 69 6e 67 20 | 65 78 63 65 70 74 69 6f |rabbing |exceptio|
|00000300| 6e 20 76 65 63 74 6f 72 | 73 20 74 6f 20 75 73 65 |n vector|s to use|
|00000310| 20 69 74 2e 20 54 68 69 | 73 20 70 72 6f 74 6f 63 | it. Thi|s protoc|
|00000320| 6f 6c 0a 77 61 73 20 6e | 6f 74 20 69 6e 76 65 6e |ol.was n|ot inven|
|00000330| 74 65 64 20 62 79 20 6d | 65 2c 20 6e 6f 72 20 69 |ted by m|e, nor i|
|00000340| 73 20 69 74 20 70 65 72 | 66 65 63 74 20 66 6f 72 |s it per|fect for|
|00000350| 20 65 76 65 72 79 20 73 | 69 74 75 61 74 69 6f 6e | every s|ituation|
|00000360| 2c 20 62 75 74 0a 73 74 | 69 6c 6c 20 69 73 20 76 |, but.st|ill is v|
|00000370| 65 72 79 20 75 73 65 66 | 75 6c 20 62 65 63 61 75 |ery usef|ul becau|
|00000380| 73 65 20 73 6f 6d 65 74 | 68 69 6e 67 20 69 73 20 |se somet|hing is |
|00000390| 62 65 74 74 65 72 20 74 | 68 61 6e 20 6e 6f 74 68 |better t|han noth|
|000003a0| 69 6e 67 2e 20 54 68 65 | 72 65 0a 68 61 76 65 20 |ing. The|re.have |
|000003b0| 62 65 65 6e 20 6f 74 68 | 65 72 20 70 72 6f 70 6f |been oth|er propo|
|000003c0| 73 61 6c 73 2c 20 62 75 | 74 20 49 4d 48 4f 20 74 |sals, bu|t IMHO t|
|000003d0| 68 69 73 20 69 73 20 74 | 68 65 20 73 69 6d 70 6c |his is t|he simpl|
|000003e0| 65 73 74 20 61 6e 64 20 | 63 6c 65 61 6e 65 73 74 |est and |cleanest|
|000003f0| 2c 0a 61 6e 64 20 64 6f | 65 73 20 74 68 65 20 6a |,.and do|es the j|
|00000400| 6f 62 20 66 6f 72 20 77 | 68 69 63 68 20 69 74 20 |ob for w|hich it |
|00000410| 77 61 73 20 64 65 73 69 | 67 6e 65 64 20 71 75 69 |was desi|gned qui|
|00000420| 74 65 20 77 65 6c 6c 2e | 20 49 74 20 68 61 73 20 |te well.| It has |
|00000430| 62 65 65 6e 0a 75 73 65 | 64 20 71 75 69 74 65 20 |been.use|d quite |
|00000440| 77 69 64 65 6c 79 2c 20 | 65 73 70 65 63 69 61 6c |widely, |especial|
|00000450| 6c 79 20 69 6e 20 50 75 | 62 6c 69 63 20 44 6f 6d |ly in Pu|blic Dom|
|00000460| 61 69 6e 20 63 69 72 63 | 6c 65 73 2c 20 61 6e 64 |ain circ|les, and|
|00000470| 20 74 68 61 74 20 69 73 | 20 61 0a 67 6f 6f 64 20 | that is| a.good |
|00000480| 65 6e 6f 75 67 68 20 72 | 65 61 73 6f 6e 20 66 6f |enough r|eason fo|
|00000490| 72 20 6d 65 20 74 6f 20 | 66 6f 6c 6c 6f 77 20 69 |r me to |follow i|
|000004a0| 74 2e 0a 0a 5c 73 65 63 | 74 69 6f 6e 7b 48 69 73 |t...\sec|tion{His|
|000004b0| 74 6f 72 79 7d 0a 4a 75 | 73 74 20 74 6f 20 73 65 |tory}.Ju|st to se|
|000004c0| 74 20 74 68 65 20 72 65 | 63 6f 72 64 20 73 74 72 |t the re|cord str|
|000004d0| 61 69 67 68 74 2c 20 61 | 6e 64 20 67 69 76 65 20 |aight, a|nd give |
|000004e0| 63 72 65 64 69 74 20 77 | 68 65 72 65 20 69 74 20 |credit w|here it |
|000004f0| 69 73 20 64 75 65 2c 20 | 74 68 65 0a 6f 72 69 67 |is due, |the.orig|
|00000500| 69 6e 61 6c 20 70 72 6f | 70 6f 73 61 6c 20 66 6f |inal pro|posal fo|
|00000510| 72 20 74 68 69 73 20 70 | 72 6f 74 6f 63 6f 6c 20 |r this p|rotocol |
|00000520| 77 61 73 20 6d 61 64 65 | 20 62 79 20 4d 6f 73 68 |was made| by Mosh|
|00000530| 65 20 42 72 61 6e 65 72 | 20 69 6e 20 61 6e 0a 55 |e Braner| in an.U|
|00000540| 73 65 6e 65 74 20 61 72 | 74 69 63 6c 65 20 73 6f |senet ar|ticle so|
|00000550| 6d 65 74 69 6d 65 20 69 | 6e 20 31 39 38 38 20 28 |metime i|n 1988 (|
|00000560| 6f 72 20 77 61 73 20 69 | 74 20 38 37 2c 20 49 20 |or was i|t 87, I |
|00000570| 64 6f 20 6e 6f 74 20 72 | 65 6d 65 6d 62 65 72 29 |do not r|emember)|
|00000580| 2e 20 54 68 65 0a 70 72 | 6f 70 6f 73 61 6c 20 77 |. The.pr|oposal w|
|00000590| 61 73 20 77 6f 72 6b 65 | 64 20 6f 76 65 72 20 62 |as worke|d over b|
|000005a0| 79 20 4a 75 6c 69 61 6e | 20 52 65 73 63 68 6b 65 |y Julian| Reschke|
|000005b0| 20 69 6e 20 63 6f 6e 73 | 75 6c 74 61 74 69 6f 6e | in cons|ultation|
|000005c0| 20 77 69 74 68 0a 45 64 | 67 61 72 20 52 5c 22 6f | with.Ed|gar R\"o|
|000005d0| 65 64 65 72 20 69 6e 20 | 47 65 72 6d 61 6e 79 2c |eder in |Germany,|
|000005e0| 20 77 68 65 72 65 20 69 | 74 20 65 6e 64 65 64 20 | where i|t ended |
|000005f0| 75 70 0a 69 6e 20 74 68 | 65 20 70 72 65 73 65 6e |up.in th|e presen|
|00000600| 74 20 66 6f 72 6d 2e 20 | 20 4a 75 6c 69 61 6e 20 |t form. | Julian |
|00000610| 52 65 73 63 68 6b 65 20 | 68 61 73 20 73 69 6e 63 |Reschke |has sinc|
|00000620| 65 20 62 65 65 6e 20 69 | 74 73 20 63 68 69 65 66 |e been i|ts chief|
|00000630| 20 73 70 6f 6b 65 73 6d | 61 6e 2c 20 61 6e 64 0a | spokesm|an, and.|
|00000640| 63 6c 65 61 72 69 6e 67 | 20 68 6f 75 73 65 20 66 |clearing| house f|
|00000650| 6f 72 20 72 65 67 69 73 | 74 65 72 69 6e 67 20 75 |or regis|tering u|
|00000660| 6e 69 71 75 65 20 58 42 | 52 41 20 69 64 65 6e 74 |nique XB|RA ident|
|00000670| 69 66 69 65 72 73 2e 20 | 41 74 61 72 69 20 47 65 |ifiers. |Atari Ge|
|00000680| 72 6d 61 6e 79 20 61 64 | 6f 70 74 65 64 0a 58 42 |rmany ad|opted.XB|
|00000690| 52 41 20 61 73 20 61 6e | 20 60 60 6f 66 66 69 63 |RA as an| ``offic|
|000006a0| 69 61 6c 27 27 20 73 74 | 61 6e 64 61 72 64 20 69 |ial'' st|andard i|
|000006b0| 6e 20 31 39 38 39 20 62 | 75 74 20 64 69 64 6e 27 |n 1989 b|ut didn'|
|000006c0| 74 20 64 6f 20 61 6e 79 | 74 68 69 6e 67 20 74 6f |t do any|thing to|
|000006d0| 20 70 75 73 68 20 69 74 | 2e 0a 58 42 52 41 20 61 | push it|..XBRA a|
|000006e0| 73 20 49 20 6b 6e 6f 77 | 20 69 74 2c 20 63 61 6d |s I know| it, cam|
|000006f0| 65 0a 62 61 63 6b 20 74 | 6f 20 6d 65 20 66 72 6f |e.back t|o me fro|
|00000700| 6d 20 47 65 72 6d 61 6e | 79 20 69 6e 20 74 68 65 |m German|y in the|
|00000710| 20 66 6f 72 6d 20 6f 66 | 20 61 6e 20 69 6e 63 6c | form of| an incl|
|00000720| 75 64 65 20 66 69 6c 65 | 20 66 6f 72 20 74 68 65 |ude file| for the|
|00000730| 20 47 6e 75 20 43 0a 6c | 69 62 72 61 72 79 2c 20 | Gnu C.l|ibrary, |
|00000740| 74 68 61 6e 6b 73 20 74 | 6f 20 45 64 67 61 72 20 |thanks t|o Edgar |
|00000750| 52 5c 22 6f 65 64 65 72 | 2e 20 49 6e 20 63 61 73 |R\"oeder|. In cas|
|00000760| 65 20 79 6f 75 20 61 72 | 65 20 77 6f 6e 64 65 72 |e you ar|e wonder|
|00000770| 69 6e 67 20 58 42 52 41 | 20 69 73 20 61 6e 0a 61 |ing XBRA| is an.a|
|00000780| 62 62 72 65 76 69 61 74 | 69 6f 6e 20 66 6f 72 20 |bbreviat|ion for |
|00000790| 65 7b 5c 62 66 20 58 7d | 74 65 6e 64 65 64 20 7b |e{\bf X}|tended {|
|000007a0| 5c 62 66 20 42 52 41 7d | 6e 65 72 20 70 72 6f 74 |\bf BRA}|ner prot|
|000007b0| 6f 63 6f 6c 2e 0a 0a 5c | 73 65 63 74 69 6f 6e 7b |ocol...\|section{|
|000007c0| 57 68 79 20 58 42 52 41 | 7d 0a 4f 6e 20 74 68 65 |Why XBRA|}.On the|
|000007d0| 20 36 38 4b 20 61 72 63 | 68 69 74 65 63 74 75 72 | 68K arc|hitectur|
|000007e0| 65 2c 20 77 68 65 6e 65 | 76 65 72 20 61 6e 20 65 |e, whene|ver an e|
|000007f0| 78 63 65 70 74 69 6f 6e | 20 6f 63 63 75 72 73 2c |xception| occurs,|
|00000800| 20 74 68 65 20 63 75 72 | 72 65 6e 74 0a 70 72 6f | the cur|rent.pro|
|00000810| 63 65 73 73 6f 72 20 73 | 74 61 74 65 5c 66 6f 6f |cessor s|tate\foo|
|00000820| 74 6e 6f 74 65 7b 57 68 | 61 74 20 61 6e 64 20 68 |tnote{Wh|at and h|
|00000830| 6f 77 20 6d 75 63 68 20 | 6f 66 20 74 68 65 20 70 |ow much |of the p|
|00000840| 72 6f 63 65 73 73 6f 72 | 20 73 74 61 74 65 20 69 |rocessor| state i|
|00000850| 73 0a 73 61 76 65 64 20 | 76 61 72 69 65 73 20 77 |s.saved |varies w|
|00000860| 69 74 68 20 64 69 66 66 | 65 72 65 6e 74 20 6d 6f |ith diff|erent mo|
|00000870| 64 65 6c 73 20 6f 66 20 | 74 68 65 20 36 38 4b 20 |dels of |the 68K |
|00000880| 66 61 6d 69 6c 79 2e 7d | 24 7b 7d 5e 2c 24 5c 66 |family.}|${}^,$\f|
|00000890| 6f 6f 74 6e 6f 74 65 7b | 54 68 69 73 0a 73 61 76 |ootnote{|This.sav|
|000008a0| 65 64 20 69 6e 66 6f 72 | 6d 61 74 69 6f 6e 20 69 |ed infor|mation i|
|000008b0| 73 20 6b 6e 6f 77 6e 20 | 61 73 20 61 6e 20 45 78 |s known |as an Ex|
|000008c0| 63 65 70 74 69 6f 6e 20 | 46 72 61 6d 65 2e 7d 20 |ception |Frame.} |
|000008d0| 69 73 20 73 61 76 65 64 | 20 6f 6e 20 74 68 65 0a |is saved| on the.|
|000008e0| 73 75 70 65 72 76 69 73 | 6f 72 20 73 74 61 63 6b |supervis|or stack|
|000008f0| 20 28 53 53 50 29 2c 20 | 61 6e 64 20 74 68 65 6e | (SSP), |and then|
|00000900| 20 74 68 65 20 70 72 6f | 63 65 73 73 6f 72 20 65 | the pro|cessor e|
|00000910| 66 66 65 63 74 69 76 65 | 6c 79 20 6a 75 6d 70 73 |ffective|ly jumps|
|00000920| 0a 69 6e 64 69 72 65 63 | 74 6c 79 20 76 69 61 20 |.indirec|tly via |
|00000930| 61 20 66 69 78 65 64 20 | 6c 6f 63 61 74 69 6f 6e |a fixed |location|
|00000940| 20 69 6e 20 6d 65 6d 6f | 72 79 20 74 6f 20 63 6f | in memo|ry to co|
|00000950| 64 65 20 74 68 61 74 20 | 77 69 6c 6c 20 68 61 6e |de that |will han|
|00000960| 64 6c 65 0a 74 68 61 74 | 20 65 78 63 65 70 74 69 |dle.that| excepti|
|00000970| 6f 6e 2e 20 20 54 68 69 | 73 20 66 69 78 65 64 20 |on. Thi|s fixed |
|00000980| 6c 6f 63 61 74 69 6f 6e | 20 69 73 20 6b 6e 6f 77 |location| is know|
|00000990| 6e 20 61 73 20 74 68 65 | 20 65 78 63 65 70 74 69 |n as the| excepti|
|000009a0| 6f 6e 20 76 65 63 74 6f | 72 0a 66 6f 72 20 74 68 |on vecto|r.for th|
|000009b0| 61 74 20 70 61 72 74 69 | 63 75 6c 61 72 20 65 78 |at parti|cular ex|
|000009c0| 63 65 70 74 69 6f 6e 2e | 20 45 78 63 65 70 74 69 |ception.| Excepti|
|000009d0| 6f 6e 20 76 65 63 74 6f | 72 73 20 61 72 65 20 6d |on vecto|rs are m|
|000009e0| 65 6d 6f 72 79 20 6c 6f | 63 61 74 69 6f 6e 73 0a |emory lo|cations.|
|000009f0| 66 72 6f 6d 20 77 68 69 | 63 68 20 74 68 65 20 70 |from whi|ch the p|
|00000a00| 72 6f 63 65 73 73 6f 72 | 20 66 65 74 63 68 65 73 |rocessor| fetches|
|00000a10| 20 74 68 65 20 61 64 64 | 72 65 73 73 20 6f 66 20 | the add|ress of |
|00000a20| 74 68 65 20 63 6f 64 65 | 20 74 68 61 74 20 77 69 |the code| that wi|
|00000a30| 6c 6c 0a 68 61 6e 64 6c | 65 20 74 68 61 74 20 65 |ll.handl|e that e|
|00000a40| 78 63 65 70 74 69 6f 6e | 20 77 68 65 6e 20 69 74 |xception| when it|
|00000a50| 20 6f 63 63 75 72 73 2e | 20 49 6e 69 74 69 61 6c | occurs.| Initial|
|00000a60| 6c 79 2c 20 61 6c 6c 20 | 65 78 63 65 70 74 69 6f |ly, all |exceptio|
|00000a70| 6e 20 76 65 63 74 6f 72 | 73 0a 61 72 65 20 69 6e |n vector|s.are in|
|00000a80| 69 74 69 61 6c 69 7a 65 | 64 20 62 79 20 54 4f 53 |itialize|d by TOS|
|00000a90| 20 74 6f 20 70 6f 69 6e | 74 20 74 6f 20 68 61 6e | to poin|t to han|
|00000aa0| 64 6c 65 72 73 20 66 6f | 72 20 74 68 65 20 65 78 |dlers fo|r the ex|
|00000ab0| 63 65 70 74 69 6f 6e 73 | 20 77 69 74 68 69 6e 0a |ceptions| within.|
|00000ac0| 54 4f 53 2e 0a 0a 4e 6f | 77 20 73 75 70 70 6f 73 |TOS...No|w suppos|
|00000ad0| 65 20 6f 6e 20 61 6e 20 | 65 78 63 65 70 74 69 6f |e on an |exceptio|
|00000ae0| 6e 2c 20 79 6f 75 72 20 | 70 72 6f 67 72 61 6d 20 |n, your |program |
|00000af0| 6e 65 65 64 73 20 74 6f | 20 67 65 74 20 63 6f 6e |needs to| get con|
|00000b00| 74 72 6f 6c 20 28 73 61 | 79 20 74 6f 0a 73 65 74 |trol (sa|y to.set|
|00000b10| 20 61 20 76 61 72 69 61 | 62 6c 65 29 2e 20 41 20 | a varia|ble). A |
|00000b20| 63 6f 6d 6d 6f 6e 20 70 | 72 61 63 74 69 63 65 20 |common p|ractice |
|00000b30| 69 73 20 74 6f 20 60 60 | 68 6f 6f 6b 20 79 6f 75 |is to ``|hook you|
|00000b40| 72 20 63 6f 64 65 20 69 | 6e 74 6f 20 74 68 65 0a |r code i|nto the.|
|00000b50| 65 78 63 65 70 74 69 6f | 6e 20 70 72 6f 63 65 73 |exceptio|n proces|
|00000b60| 73 69 6e 67 20 63 68 61 | 69 6e 27 27 2c 20 66 6f |sing cha|in'', fo|
|00000b70| 72 20 74 68 65 20 70 61 | 72 74 69 63 75 6c 61 72 |r the pa|rticular|
|00000b80| 20 65 78 63 65 70 74 69 | 6f 6e 20 74 68 61 74 20 | excepti|on that |
|00000b90| 79 6f 75 72 0a 70 72 6f | 67 72 61 6d 20 69 73 20 |your.pro|gram is |
|00000ba0| 69 6e 74 65 72 65 73 74 | 65 64 20 69 6e 2e 20 57 |interest|ed in. W|
|00000bb0| 68 61 74 20 77 65 20 6d | 65 61 6e 20 62 79 20 60 |hat we m|ean by `|
|00000bc0| 60 68 6f 6f 6b 69 6e 67 | 20 79 6f 75 72 20 63 6f |`hooking| your co|
|00000bd0| 64 65 20 69 6e 27 27 20 | 69 73 0a 74 68 61 74 20 |de in'' |is.that |
|00000be0| 79 6f 75 20 6d 61 6b 65 | 20 74 68 65 20 65 78 63 |you make| the exc|
|00000bf0| 65 70 74 69 6f 6e 20 76 | 65 63 74 6f 72 20 70 6f |eption v|ector po|
|00000c00| 69 6e 74 20 74 6f 20 79 | 6f 75 72 20 63 6f 64 65 |int to y|our code|
|00000c10| 2c 20 77 68 69 63 68 20 | 69 6e 20 74 75 72 6e 73 |, which |in turns|
|00000c20| 0a 70 6f 69 6e 74 73 20 | 74 6f 20 77 68 65 72 65 |.points |to where|
|00000c30| 76 65 72 20 74 68 65 20 | 6f 72 69 67 69 6e 61 6c |ver the |original|
|00000c40| 20 65 78 63 65 70 74 69 | 6f 6e 20 76 65 63 74 6f | excepti|on vecto|
|00000c50| 72 20 77 61 73 20 70 6f | 69 6e 74 69 6e 67 20 74 |r was po|inting t|
|00000c60| 6f 2e 20 57 68 65 6e 20 | 74 68 65 0a 65 78 63 65 |o. When |the.exce|
|00000c70| 70 74 69 6f 6e 20 6f 63 | 63 75 72 73 2c 20 79 6f |ption oc|curs, yo|
|00000c80| 75 72 20 63 6f 64 65 20 | 69 73 20 67 69 76 65 6e |ur code |is given|
|00000c90| 20 63 6f 6e 74 72 6f 6c | 2c 20 61 6e 64 20 6f 6e | control|, and on|
|00000ca0| 63 65 20 69 74 20 68 61 | 73 20 64 6f 6e 65 20 69 |ce it ha|s done i|
|00000cb0| 74 73 0a 6a 6f 62 2c 20 | 63 6f 6e 74 72 6f 6c 20 |ts.job, |control |
|00000cc0| 70 61 73 73 65 73 20 74 | 6f 20 6f 74 68 65 72 20 |passes t|o other |
|00000cd0| 65 78 63 65 70 74 69 6f | 6e 20 68 61 6e 64 6c 65 |exceptio|n handle|
|00000ce0| 72 73 20 69 6e 20 74 68 | 65 20 63 68 61 69 6e 2e |rs in th|e chain.|
|00000cf0| 20 54 68 65 20 6c 61 73 | 74 0a 68 61 6e 64 6c 65 | The las|t.handle|
|00000d00| 72 20 69 6e 20 74 68 69 | 73 20 63 68 61 69 6e 20 |r in thi|s chain |
|00000d10| 28 75 73 75 61 6c 6c 79 | 20 74 68 65 20 6f 6e 65 |(usually| the one|
|00000d20| 20 69 6e 73 74 61 6c 6c | 65 64 20 74 68 65 72 65 | install|ed there|
|00000d30| 20 69 6e 69 74 69 61 6c | 6c 79 20 62 79 0a 54 4f | initial|ly by.TO|
|00000d40| 53 29 2c 20 66 69 6e 69 | 73 68 65 73 20 6f 66 66 |S), fini|shes off|
|00000d50| 20 74 68 65 20 65 78 63 | 65 70 74 69 6f 6e 20 68 | the exc|eption h|
|00000d60| 61 6e 64 6c 69 6e 67 20 | 73 65 71 75 65 6e 63 65 |andling |sequence|
|00000d70| 20 62 79 20 65 78 65 63 | 75 74 69 6e 67 20 61 20 | by exec|uting a |
|00000d80| 52 54 45 0a 69 6e 73 74 | 72 75 63 74 69 6f 6e 2c |RTE.inst|ruction,|
|00000d90| 20 77 68 69 63 68 20 72 | 65 73 74 6f 72 65 73 20 | which r|estores |
|00000da0| 74 68 65 20 70 72 6f 63 | 65 73 73 6f 72 20 74 6f |the proc|essor to|
|00000db0| 20 74 68 65 20 73 74 61 | 74 65 20 69 6e 20 77 68 | the sta|te in wh|
|00000dc0| 69 63 68 20 69 74 20 77 | 61 73 20 62 65 66 6f 72 |ich it w|as befor|
|00000dd0| 65 0a 74 68 65 20 65 78 | 63 65 70 74 69 6f 6e 20 |e.the ex|ception |
|00000de0| 6f 63 63 75 72 72 65 64 | 2e 20 46 69 67 75 72 65 |occurred|. Figure|
|00000df0| 7e 5c 72 65 66 7b 66 69 | 67 3a 68 6f 6f 6b 69 6e |~\ref{fi|g:hookin|
|00000e00| 67 7d 20 64 65 70 69 63 | 74 73 20 77 68 61 74 0a |g} depic|ts what.|
|00000e10| 68 61 70 70 65 6e 73 20 | 77 68 65 6e 20 79 6f 75 |happens |when you|
|00000e20| 20 60 60 68 6f 6f 6b 20 | 69 6e 20 79 6f 75 72 20 | ``hook |in your |
|00000e30| 63 6f 64 65 27 27 2e 0a | 0a 5c 62 65 67 69 6e 7b |code''..|.\begin{|
|00000e40| 66 69 67 75 72 65 7d 0a | 5c 62 65 67 69 6e 7b 63 |figure}.|\begin{c|
|00000e50| 65 6e 74 65 72 7d 0a 7b | 5c 73 6d 61 6c 6c 25 0a |enter}.{|\small%.|
|00000e60| 5c 69 6e 70 75 74 20 66 | 69 67 31 2e 74 65 78 0a |\input f|ig1.tex.|
|00000e70| 7d 0a 5c 63 61 70 74 69 | 6f 6e 7b 48 6f 6f 6b 69 |}.\capti|on{Hooki|
|00000e80| 6e 67 20 69 6e 74 6f 20 | 61 6e 20 45 78 63 65 70 |ng into |an Excep|
|00000e90| 74 69 6f 6e 20 56 65 63 | 74 6f 72 7d 0a 5c 6c 61 |tion Vec|tor}.\la|
|00000ea0| 62 65 6c 7b 66 69 67 3a | 68 6f 6f 6b 69 6e 67 7d |bel{fig:|hooking}|
|00000eb0| 0a 5c 65 6e 64 7b 63 65 | 6e 74 65 72 7d 0a 5c 65 |.\end{ce|nter}.\e|
|00000ec0| 6e 64 7b 66 69 67 75 72 | 65 7d 0a 0a 49 74 20 69 |nd{figur|e}..It i|
|00000ed0| 73 20 62 61 64 20 7b 5c | 69 74 20 6b 61 72 6d 61 |s bad {\|it karma|
|00000ee0| 7d 20 6e 6f 74 20 74 6f | 20 70 61 73 73 20 61 20 |} not to| pass a |
|00000ef0| 63 6f 6e 74 72 6f 6c 20 | 74 6f 20 74 68 65 20 6e |control |to the n|
|00000f00| 65 78 74 20 65 78 63 65 | 70 74 69 6f 6e 0a 68 61 |ext exce|ption.ha|
|00000f10| 6e 64 6c 65 72 20 69 6e | 20 74 68 65 20 63 68 61 |ndler in| the cha|
|00000f20| 69 6e 2e 20 45 76 65 6e | 20 69 66 20 79 6f 75 72 |in. Even| if your|
|00000f30| 20 63 6f 64 65 20 63 61 | 6e 20 63 6f 6d 70 6c 65 | code ca|n comple|
|00000f40| 74 65 6c 79 20 68 61 6e | 64 6c 65 20 61 6e 0a 65 |tely han|dle an.e|
|00000f50| 78 63 65 70 74 69 6f 6e | 2c 20 69 74 20 64 65 6e |xception|, it den|
|00000f60| 69 65 73 20 6f 74 68 65 | 72 20 68 61 6e 64 6c 65 |ies othe|r handle|
|00000f70| 72 73 20 74 68 65 20 6f | 70 70 6f 72 74 75 6e 69 |rs the o|pportuni|
|00000f80| 74 79 20 74 6f 20 64 6f | 20 77 68 61 74 20 74 68 |ty to do| what th|
|00000f90| 65 79 0a 73 75 70 70 6f | 73 65 64 20 74 6f 20 64 |ey.suppo|sed to d|
|00000fa0| 6f 2e 20 4f 66 20 63 6f | 75 72 73 65 2c 20 74 68 |o. Of co|urse, th|
|00000fb0| 65 72 65 20 61 72 65 20 | 73 69 74 75 61 74 69 6f |ere are |situatio|
|00000fc0| 6e 73 20 77 68 65 72 65 | 0a 70 61 73 73 69 6e 67 |ns where|.passing|
|00000fd0| 20 63 6f 6e 74 72 6f 6c | 20 74 6f 20 6f 74 68 65 | control| to othe|
|00000fe0| 72 20 68 61 6e 64 6c 65 | 72 73 20 69 73 20 6e 6f |r handle|rs is no|
|00000ff0| 74 20 61 70 70 72 6f 70 | 72 69 61 74 65 20 28 66 |t approp|riate (f|
|00001000| 6f 72 20 69 6e 73 74 61 | 6e 63 65 20 69 66 0a 79 |or insta|nce if.y|
|00001010| 6f 75 20 61 72 65 20 69 | 6e 74 65 72 63 65 70 74 |ou are i|ntercept|
|00001020| 69 6e 67 20 61 20 70 61 | 72 74 69 63 75 6c 61 72 |ing a pa|rticular|
|00001030| 20 67 65 6d 64 6f 73 20 | 66 75 6e 63 74 69 6f 6e | gemdos |function|
|00001040| 0a 69 6e 20 6f 72 64 65 | 72 20 74 6f 20 72 65 70 |.in orde|r to rep|
|00001050| 6c 61 63 65 20 69 74 20 | 74 6f 74 61 6c 6c 79 3b |lace it |totally;|
|00001060| 20 69 6e 20 6d 6f 73 74 | 20 6f 74 68 65 72 0a 63 | in most| other.c|
|00001070| 61 73 65 73 20 79 6f 75 | 20 70 61 73 73 69 6e 67 |ases you| passing|
|00001080| 20 63 6f 6e 74 72 6f 6c | 20 6f 6e 20 74 6f 20 74 | control| on to t|
|00001090| 68 65 20 6e 65 78 74 20 | 68 61 6e 64 6c 65 72 20 |he next |handler |
|000010a0| 69 73 20 74 68 65 20 74 | 68 69 6e 67 20 74 6f 20 |is the t|hing to |
|000010b0| 64 6f 29 2e 0a 0a 57 68 | 65 6e 20 79 6f 75 20 69 |do)...Wh|en you i|
|000010c0| 6e 73 74 61 6c 6c 20 61 | 20 68 61 6e 64 6c 65 72 |nstall a| handler|
|000010d0| 2c 20 62 79 20 63 6f 6e | 76 65 6e 74 69 6f 6e 20 |, by con|vention |
|000010e0| 79 6f 75 20 69 6e 73 74 | 61 6c 6c 20 69 74 20 61 |you inst|all it a|
|000010f0| 74 20 74 68 65 20 68 65 | 61 64 0a 6f 66 20 74 68 |t the he|ad.of th|
|00001100| 65 20 65 78 63 65 70 74 | 69 6f 6e 20 63 68 61 69 |e except|ion chai|
|00001110| 6e 2e 20 42 75 74 20 79 | 6f 75 20 63 61 6e 6e 6f |n. But y|ou canno|
|00001120| 74 20 61 73 73 75 6d 65 | 20 74 68 61 74 20 79 6f |t assume| that yo|
|00001130| 75 72 20 68 61 6e 64 6c | 65 72 20 77 69 6c 6c 0a |ur handl|er will.|
|00001140| 61 6c 77 61 79 73 20 72 | 65 6d 61 69 6e 20 74 68 |always r|emain th|
|00001150| 65 72 65 2e 20 4f 74 68 | 65 72 20 70 72 6f 63 65 |ere. Oth|er proce|
|00001160| 73 73 65 73 20 63 61 6e | 20 65 78 65 63 75 74 65 |sses can| execute|
|00001170| 20 6c 61 74 65 72 20 61 | 6e 64 20 6d 61 79 20 69 | later a|nd may i|
|00001180| 6e 73 65 72 74 0a 74 68 | 65 69 72 20 6f 77 6e 20 |nsert.th|eir own |
|00001190| 65 78 63 65 70 74 69 6f | 6e 20 68 61 6e 64 6c 65 |exceptio|n handle|
|000011a0| 72 73 2e 20 57 68 65 6e | 20 69 74 20 63 6f 6d 65 |rs. When| it come|
|000011b0| 73 20 74 69 6d 65 20 74 | 6f 20 75 6e 68 6f 6f 6b |s time t|o unhook|
|000011c0| 0a 66 69 72 73 74 20 79 | 6f 75 20 6e 65 65 64 20 |.first y|ou need |
|000011d0| 74 6f 20 66 69 6e 64 20 | 79 6f 75 72 73 65 6c 66 |to find |yourself|
|000011e0| 2e 20 54 68 69 73 20 69 | 73 20 77 68 65 72 65 0a |. This i|s where.|
|000011f0| 58 42 52 41 20 63 6f 6d | 65 73 20 69 6e 74 6f 20 |XBRA com|es into |
|00001200| 69 74 73 20 6f 77 6e 2e | 20 49 66 20 74 68 65 20 |its own.| If the |
|00001210| 65 78 63 65 70 74 69 6f | 6e 20 76 65 63 74 6f 72 |exceptio|n vector|
|00001220| 20 28 74 68 65 20 68 65 | 61 64 20 6f 66 20 74 68 | (the he|ad of th|
|00001230| 65 0a 63 68 61 69 6e 29 | 20 64 6f 65 73 20 6e 6f |e.chain)| does no|
|00001240| 74 20 70 6f 69 6e 74 20 | 74 6f 20 79 6f 75 72 20 |t point |to your |
|00001250| 68 61 6e 64 6c 65 72 20 | 74 68 65 72 65 20 69 73 |handler |there is|
|00001260| 20 6e 6f 20 77 61 79 20 | 79 6f 75 20 63 61 6e 20 | no way |you can |
|00001270| 66 69 6e 64 20 69 74 2c | 0a 75 6e 6c 65 73 73 20 |find it,|.unless |
|00001280| 61 6c 6c 20 68 61 6e 64 | 6c 65 72 73 20 62 65 74 |all hand|lers bet|
|00001290| 77 65 65 6e 20 74 68 65 | 20 68 65 61 64 20 61 6e |ween the| head an|
|000012a0| 64 20 79 6f 75 20 66 6f | 6c 6c 6f 77 20 61 20 63 |d you fo|llow a c|
|000012b0| 6f 6d 6d 6f 6e 0a 63 6f | 6e 76 65 6e 74 69 6f 6e |ommon.co|nvention|
|000012c0| 73 20 74 6f 20 69 64 65 | 6e 74 69 66 79 20 74 68 |s to ide|ntify th|
|000012d0| 65 20 68 61 6e 64 6c 65 | 72 20 61 6e 64 20 74 6f |e handle|r and to|
|000012e0| 20 66 69 6e 64 20 74 68 | 65 20 70 6f 69 6e 74 65 | find th|e pointe|
|000012f0| 72 20 74 6f 0a 74 68 65 | 20 6e 65 78 74 20 65 6c |r to.the| next el|
|00001300| 65 6d 65 6e 74 20 6f 66 | 20 74 68 69 73 20 63 68 |ement of| this ch|
|00001310| 61 69 6e 2e 20 54 68 65 | 0a 58 42 52 41 20 70 72 |ain. The|.XBRA pr|
|00001320| 6f 74 6f 63 6f 6c 20 73 | 70 65 63 69 66 69 65 73 |otocol s|pecifies|
|00001330| 20 77 68 65 72 65 20 74 | 6f 20 66 69 6e 64 2c 20 | where t|o find, |
|00001340| 72 65 6c 61 74 69 76 65 | 20 74 6f 20 74 68 65 20 |relative| to the |
|00001350| 62 65 67 69 6e 6e 69 6e | 67 20 6f 66 20 61 20 68 |beginnin|g of a h|
|00001360| 61 6e 64 6c 65 72 2c 0a | 74 68 65 20 6e 65 78 74 |andler,.|the next|
|00001370| 20 68 61 6e 64 6c 65 72 | 20 61 64 64 72 65 73 73 | handler| address|
|00001380| 2e 20 54 6f 20 61 76 6f | 69 64 20 73 70 75 72 69 |. To avo|id spuri|
|00001390| 6f 75 73 20 69 64 65 6e | 74 69 66 69 63 61 74 69 |ous iden|tificati|
|000013a0| 6f 6e 0a 74 68 65 20 58 | 42 52 41 20 70 72 6f 74 |on.the X|BRA prot|
|000013b0| 6f 63 6f 6c 20 66 75 72 | 74 68 65 72 20 64 65 66 |ocol fur|ther def|
|000013c0| 69 6e 65 73 20 74 77 6f | 20 6d 61 67 69 63 20 6e |ines two| magic n|
|000013d0| 75 6d 62 65 72 73 2c 20 | 61 67 61 69 6e 20 61 74 |umbers, |again at|
|000013e0| 20 66 69 78 65 64 0a 6f | 66 66 73 65 74 73 20 72 | fixed.o|ffsets r|
|000013f0| 65 6c 61 74 69 76 65 20 | 74 6f 20 74 68 65 20 68 |elative |to the h|
|00001400| 61 6e 64 6c 65 72 2e 20 | 20 4e 6f 77 20 75 6e 63 |andler. | Now unc|
|00001410| 68 61 69 6e 69 6e 67 20 | 79 6f 75 72 73 65 6c 66 |haining |yourself|
|00001420| 20 62 65 63 6f 6d 65 73 | 20 65 61 73 79 0a 61 6e | becomes| easy.an|
|00001430| 64 20 72 65 6c 69 61 62 | 6c 65 2e 20 59 6f 75 20 |d reliab|le. You |
|00001440| 65 69 74 68 65 72 20 65 | 6e 63 6f 75 6e 74 65 72 |either e|ncounter|
|00001450| 65 64 20 79 6f 75 72 73 | 65 6c 66 2c 20 6f 72 20 |ed yours|elf, or |
|00001460| 79 6f 75 20 63 6f 6e 74 | 69 6e 75 65 0a 64 6f 77 |you cont|inue.dow|
|00001470| 6e 20 74 68 65 20 63 68 | 61 69 6e 20 62 79 20 70 |n the ch|ain by p|
|00001480| 69 63 6b 69 6e 67 20 75 | 70 20 74 68 65 20 61 64 |icking u|p the ad|
|00001490| 64 72 65 73 73 20 6f 66 | 20 74 68 65 20 6e 65 78 |dress of| the nex|
|000014a0| 74 20 68 61 6e 64 6c 65 | 72 20 66 72 6f 6d 20 61 |t handle|r from a|
|000014b0| 0a 66 69 78 65 64 20 6f | 66 66 73 65 74 20 69 6e |.fixed o|ffset in|
|000014c0| 20 74 68 65 20 63 75 72 | 72 65 6e 74 20 68 61 6e | the cur|rent han|
|000014d0| 64 6c 65 72 2e 20 20 4f | 6e 63 65 20 79 6f 75 20 |dler. O|nce you |
|000014e0| 68 61 76 65 20 66 6f 75 | 6e 64 20 79 6f 75 72 73 |have fou|nd yours|
|000014f0| 65 6c 66 0a 79 6f 75 20 | 63 68 65 63 6b 20 74 68 |elf.you |check th|
|00001500| 65 20 74 77 6f 20 6d 61 | 67 69 63 20 6e 75 6d 62 |e two ma|gic numb|
|00001510| 65 72 73 2c 20 61 67 61 | 69 6e 20 61 74 20 66 69 |ers, aga|in at fi|
|00001520| 78 65 64 20 6f 66 66 73 | 65 74 73 2c 20 74 6f 20 |xed offs|ets, to |
|00001530| 65 6e 73 75 72 65 0a 74 | 68 61 74 20 79 6f 75 20 |ensure.t|hat you |
|00001540| 61 63 74 75 61 6c 6c 79 | 20 68 69 74 20 61 6e 20 |actually| hit an |
|00001550| 58 42 52 41 20 68 65 61 | 64 65 72 20 72 61 74 68 |XBRA hea|der rath|
|00001560| 65 72 20 74 68 61 6e 20 | 73 6f 6d 65 20 72 61 6e |er than |some ran|
|00001570| 64 6f 6d 20 6d 65 6d 6f | 72 79 0a 6c 6f 63 61 74 |dom memo|ry.locat|
|00001580| 69 6f 6e 20 74 68 61 74 | 20 6a 75 73 74 20 68 61 |ion that| just ha|
|00001590| 70 70 65 6e 73 20 74 6f | 20 68 61 76 65 20 74 68 |ppens to| have th|
|000015a0| 65 20 76 61 6c 75 65 20 | 74 68 61 74 20 79 6f 75 |e value |that you|
|000015b0| 20 61 72 65 20 6c 6f 6f | 6b 69 6e 67 0a 66 6f 72 | are loo|king.for|
|000015c0| 2e 20 49 66 20 69 74 20 | 61 6c 6c 20 63 68 65 63 |. If it |all chec|
|000015d0| 6b 73 20 6f 75 74 2c 20 | 79 6f 75 20 63 61 6e 20 |ks out, |you can |
|000015e0| 72 65 6d 6f 76 65 20 79 | 6f 75 72 73 65 6c 66 20 |remove y|ourself |
|000015f0| 72 65 6c 69 61 62 6c 79 | 2e 0a 46 69 67 75 72 65 |reliably|..Figure|
|00001600| 7e 5c 72 65 66 7b 66 69 | 67 3a 78 62 72 61 63 68 |~\ref{fi|g:xbrach|
|00001610| 61 69 6e 7d 20 69 6c 6c | 75 73 74 72 61 74 65 73 |ain} ill|ustrates|
|00001620| 20 61 20 74 79 70 69 63 | 61 6c 20 58 42 52 41 20 | a typic|al XBRA |
|00001630| 65 78 63 65 70 74 69 6f | 6e 20 63 68 61 69 6e 2e |exceptio|n chain.|
|00001640| 0a 0a 5c 62 65 67 69 6e | 7b 66 69 67 75 72 65 7d |..\begin|{figure}|
|00001650| 0a 5c 62 65 67 69 6e 7b | 63 65 6e 74 65 72 7d 0a |.\begin{|center}.|
|00001660| 7b 5c 73 6d 61 6c 6c 25 | 0a 5c 69 6e 70 75 74 20 |{\small%|.\input |
|00001670| 66 69 67 32 2e 74 65 78 | 0a 7d 0a 5c 63 61 70 74 |fig2.tex|.}.\capt|
|00001680| 69 6f 6e 7b 41 6e 20 58 | 42 52 41 20 45 78 63 65 |ion{An X|BRA Exce|
|00001690| 70 74 69 6f 6e 20 43 68 | 61 69 6e 7d 0a 5c 6c 61 |ption Ch|ain}.\la|
|000016a0| 62 65 6c 7b 66 69 67 3a | 78 62 72 61 63 68 61 69 |bel{fig:|xbrachai|
|000016b0| 6e 7d 0a 5c 65 6e 64 7b | 63 65 6e 74 65 72 7d 0a |n}.\end{|center}.|
|000016c0| 5c 65 6e 64 7b 66 69 67 | 75 72 65 7d 0a 0a 5c 70 |\end{fig|ure}..\p|
|000016d0| 61 67 65 62 72 65 61 6b | 0a 0a 5c 73 65 63 74 69 |agebreak|..\secti|
|000016e0| 6f 6e 7b 54 68 65 20 58 | 42 52 41 20 50 72 6f 74 |on{The X|BRA Prot|
|000016f0| 6f 63 6f 6c 7d 0a 41 20 | 67 65 6e 65 72 69 63 20 |ocol}.A |generic |
|00001700| 58 42 52 41 20 65 6c 65 | 6d 65 6e 74 20 6c 6f 6f |XBRA ele|ment loo|
|00001710| 6b 73 20 6c 69 6b 65 3a | 0a 7b 5c 73 6d 61 6c 6c |ks like:|.{\small|
|00001720| 25 0a 5c 62 65 67 69 6e | 7b 63 65 6e 74 65 72 7d |%.\begin|{center}|
|00001730| 0a 7b 5c 74 74 25 0a 5c | 62 65 67 69 6e 7b 74 61 |.{\tt%.\|begin{ta|
|00001740| 62 62 69 6e 67 7d 0a 78 | 78 78 78 5c 3d 78 78 78 |bbing}.x|xxx\=xxx|
|00001750| 78 78 78 78 78 78 78 78 | 5c 3d 78 78 78 78 78 78 |xxxxxxxx|\=xxxxxx|
|00001760| 78 78 78 78 78 78 78 78 | 5c 3d 20 5c 6b 69 6c 6c |xxxxxxxx|\= \kill|
|00001770| 0a 73 74 72 75 63 74 20 | 78 62 72 61 20 5c 7b 20 |.struct |xbra \{ |
|00001780| 5c 5c 0a 5c 3e 20 20 20 | 20 6c 6f 6e 67 20 5c 3e |\\.\> | long \>|
|00001790| 20 20 20 20 20 20 20 78 | 62 72 61 5c 5f 6d 61 67 | x|bra\_mag|
|000017a0| 69 63 3b 20 5c 5c 0a 5c | 3e 20 20 20 20 6c 6f 6e |ic; \\.\|> lon|
|000017b0| 67 20 5c 3e 20 20 20 20 | 20 20 20 6d 79 5c 5f 6d |g \> | my\_m|
|000017c0| 61 67 69 63 3b 20 20 20 | 5c 5c 0a 5c 3e 20 20 20 |agic; |\\.\> |
|000017d0| 20 76 6f 69 64 20 5c 3e | 20 20 20 20 20 20 20 28 | void \>| (|
|000017e0| 2a 6e 65 78 74 29 28 29 | 3b 20 20 20 20 5c 5c 0a |*next)()|; \\.|
|000017f0| 5c 3e 20 20 20 20 24 5c | 6c 61 6e 67 6c 65 24 20 |\> $\|langle$ |
|00001800| 65 78 63 65 70 74 69 6f | 6e 20 63 6f 64 65 20 68 |exceptio|n code h|
|00001810| 65 72 65 20 24 5c 72 61 | 6e 67 6c 65 24 20 5c 5c |ere $\ra|ngle$ \\|
|00001820| 0a 5c 7d 3b 0a 5c 65 6e | 64 7b 74 61 62 62 69 6e |.\};.\en|d{tabbin|
|00001830| 67 7d 7d 0a 5c 65 6e 64 | 7b 63 65 6e 74 65 72 7d |g}}.\end|{center}|
|00001840| 7d 0a 0a 7b 5c 74 74 20 | 78 62 72 61 5c 5f 6d 61 |}..{\tt |xbra\_ma|
|00001850| 67 69 63 7d 20 69 73 20 | 69 6e 69 74 69 61 6c 69 |gic} is |initiali|
|00001860| 7a 65 64 20 74 6f 20 7b | 5c 74 74 20 60 60 58 42 |zed to {|\tt ``XB|
|00001870| 52 41 27 27 7d 20 28 30 | 78 35 38 34 32 35 32 34 |RA''} (0|x5842524|
|00001880| 31 4c 20 68 65 78 29 2e | 0a 7b 5c 74 74 20 6d 79 |1L hex).|.{\tt my|
|00001890| 5c 5f 6d 61 67 69 63 7d | 20 69 73 20 61 20 33 32 |\_magic}| is a 32|
|000018a0| 20 62 69 74 20 76 61 6c | 75 65 20 74 68 61 74 20 | bit val|ue that |
|000018b0| 79 6f 75 20 63 68 6f 6f | 73 65 2e 20 49 6e 20 67 |you choo|se. In g|
|000018c0| 63 63 20 63 6f 6d 70 69 | 6c 65 64 0a 61 70 70 6c |cc compi|led.appl|
|000018d0| 69 63 61 74 69 6f 6e 73 | 20 61 20 64 65 66 61 75 |ications| a defau|
|000018e0| 6c 74 20 76 61 6c 75 65 | 20 69 73 20 7b 5c 74 74 |lt value| is {\tt|
|000018f0| 20 60 60 47 4e 55 43 27 | 27 7d 20 28 30 78 34 37 | ``GNUC'|'} (0x47|
|00001900| 34 45 35 35 34 33 4c 20 | 68 65 78 29 0a 62 75 74 |4E5543L |hex).but|
|00001910| 20 6f 66 20 63 6f 75 72 | 73 65 20 69 74 20 6d 61 | of cour|se it ma|
|00001920| 79 20 62 65 20 63 68 61 | 6e 67 65 64 2e 20 7b 5c |y be cha|nged. {\|
|00001930| 74 74 20 6e 65 78 74 7d | 20 68 6f 6c 64 73 0a 74 |tt next}| holds.t|
|00001940| 68 65 20 61 64 64 72 65 | 73 73 20 6f 66 20 74 68 |he addre|ss of th|
|00001950| 65 20 6e 65 78 74 20 65 | 78 63 65 70 74 69 6f 6e |e next e|xception|
|00001960| 20 68 61 6e 64 6c 65 72 | 20 69 6e 20 74 68 65 20 | handler| in the |
|00001970| 63 68 61 69 6e 2e 20 49 | 74 20 69 73 0a 69 6e 69 |chain. I|t is.ini|
|00001980| 74 69 61 6c 69 7a 65 64 | 20 77 68 65 6e 20 74 68 |tialized| when th|
|00001990| 65 20 68 61 6e 64 6c 65 | 72 20 69 73 20 69 6e 69 |e handle|r is ini|
|000019a0| 74 69 61 6c 6c 79 20 6c | 69 6e 6b 65 64 20 69 6e |tially l|inked in|
|000019b0| 74 6f 20 74 68 65 0a 63 | 68 61 69 6e 2c 20 6a 75 |to the.c|hain, ju|
|000019c0| 73 74 20 70 61 73 74 20 | 69 74 73 20 68 65 61 64 |st past |its head|
|000019d0| 2e 0a 54 68 65 20 63 6f | 64 65 20 66 6f 72 20 79 |..The co|de for y|
|000019e0| 6f 75 72 20 68 61 6e 64 | 6c 65 72 20 66 6f 6c 6c |our hand|ler foll|
|000019f0| 6f 77 73 20 74 68 65 20 | 7b 5c 74 74 20 6e 65 78 |ows the |{\tt nex|
|00001a00| 74 7d 20 66 69 65 6c 64 | 2e 0a 59 6f 75 20 77 69 |t} field|..You wi|
|00001a10| 6c 6c 20 6c 61 6e 64 20 | 61 74 20 74 68 65 20 61 |ll land |at the a|
|00001a20| 64 64 72 65 73 73 20 6f | 66 20 74 68 65 20 66 69 |ddress o|f the fi|
|00001a30| 72 73 74 20 77 6f 72 64 | 20 6f 66 20 74 68 69 73 |rst word| of this|
|00001a40| 0a 63 6f 64 65 20 77 68 | 65 6e 20 63 6f 6e 74 72 |.code wh|en contr|
|00001a50| 6f 6c 20 69 73 20 70 61 | 73 73 65 64 20 74 6f 20 |ol is pa|ssed to |
|00001a60| 74 68 69 73 20 68 61 6e | 64 6c 65 72 2e 0a 55 73 |this han|dler..Us|
|00001a70| 75 61 6c 6c 79 20 77 65 | 20 64 6f 20 6e 6f 74 20 |ually we| do not |
|00001a80| 70 75 74 20 6f 75 72 20 | 68 61 6e 64 6c 65 72 20 |put our |handler |
|00001a90| 72 69 67 68 74 20 69 6e | 74 6f 20 74 68 65 20 73 |right in|to the s|
|00001aa0| 74 72 75 63 74 75 72 65 | 2c 20 62 75 74 0a 69 6e |tructure|, but.in|
|00001ab0| 73 74 65 61 64 20 77 65 | 20 70 75 74 20 61 20 6a |stead we| put a j|
|00001ac0| 75 6d 70 20 69 6e 73 74 | 72 75 63 74 69 6f 6e 20 |ump inst|ruction |
|00001ad0| 74 6f 20 6f 75 72 20 68 | 61 6e 64 6c 65 72 20 72 |to our h|andler r|
|00001ae0| 6f 75 74 69 6e 65 20 69 | 6e 20 74 68 65 20 58 42 |outine i|n the XB|
|00001af0| 52 41 0a 73 74 72 75 63 | 74 75 72 65 2e 20 54 68 |RA.struc|ture. Th|
|00001b00| 69 73 20 69 73 20 61 20 | 63 6f 6e 76 65 6e 69 65 |is is a |convenie|
|00001b10| 6e 63 65 20 66 6f 72 20 | 43 20 70 72 6f 67 72 61 |nce for |C progra|
|00001b20| 6d 73 20 61 6e 64 20 6e | 6f 74 20 61 20 72 65 71 |ms and n|ot a req|
|00001b30| 75 69 72 65 6d 65 6e 74 | 20 6f 66 0a 74 68 65 20 |uirement| of.the |
|00001b40| 58 42 52 41 20 70 72 6f | 74 6f 63 6f 6c 2e 20 49 |XBRA pro|tocol. I|
|00001b50| 6e 20 43 20 74 68 65 72 | 65 20 69 73 20 6e 6f 20 |n C ther|e is no |
|00001b60| 70 6f 72 74 61 62 6c 65 | 20 77 61 79 20 74 6f 20 |portable| way to |
|00001b70| 65 6e 73 75 72 65 20 74 | 68 61 74 20 74 68 65 20 |ensure t|hat the |
|00001b80| 63 6f 64 65 20 66 6f 72 | 0a 74 68 65 20 68 61 6e |code for|.the han|
|00001b90| 64 6c 65 72 20 69 73 20 | 63 6f 6e 74 69 67 75 6f |dler is |contiguo|
|00001ba0| 75 73 20 74 6f 20 74 68 | 65 20 58 42 52 41 20 68 |us to th|e XBRA h|
|00001bb0| 65 61 64 65 72 20 61 6e | 64 20 69 6e 20 74 68 65 |eader an|d in the|
|00001bc0| 20 73 61 6d 65 20 73 65 | 63 74 69 6f 6e 20 28 74 | same se|ction (t|
|00001bd0| 65 78 74 20 6f 72 0a 64 | 61 74 61 20 73 65 63 74 |ext or.d|ata sect|
|00001be0| 69 6f 6e 29 0a 20 48 65 | 72 65 20 69 73 20 61 6e |ion). He|re is an|
|00001bf0| 20 65 78 61 6d 70 6c 65 | 20 6f 66 20 68 6f 77 20 | example| of how |
|00001c00| 74 6f 20 69 6e 73 74 61 | 6c 6c 20 61 20 68 61 6e |to insta|ll a han|
|00001c10| 64 6c 65 72 20 69 6e 74 | 6f 20 74 68 65 0a 65 76 |dler int|o the.ev|
|00001c20| 65 6e 74 20 74 69 6d 65 | 72 20 68 61 6e 64 6f 66 |ent time|r handof|
|00001c30| 66 20 76 65 63 74 6f 72 | 20 28 65 78 63 65 70 74 |f vector| (except|
|00001c40| 69 6f 6e 20 30 78 31 30 | 30 29 2e 0a 7b 5c 73 6d |ion 0x10|0)..{\sm|
|00001c50| 61 6c 6c 25 0a 5c 62 65 | 67 69 6e 7b 76 65 72 62 |all%.\be|gin{verb|
|00001c60| 61 74 69 6d 7d 0a 76 6f | 69 64 20 6d 79 5f 68 61 |atim}.vo|id my_ha|
|00001c70| 6e 64 6c 65 72 28 29 0a | 7b 0a 20 20 2f 2a 20 68 |ndler().|{. /* h|
|00001c80| 61 6e 64 6c 65 72 20 63 | 6f 64 65 20 2a 2f 0a 7d |andler c|ode */.}|
|00001c90| 0a 0a 23 64 65 66 69 6e | 65 20 5f 58 42 52 41 5f |..#defin|e _XBRA_|
|00001ca0| 4d 41 47 49 43 20 20 20 | 20 20 30 78 35 38 34 32 |MAGIC | 0x5842|
|00001cb0| 35 32 34 31 4c 20 2f 2a | 20 22 58 42 52 41 22 20 |5241L /*| "XBRA" |
|00001cc0| 2a 2f 0a 23 64 65 66 69 | 6e 65 20 5f 47 4e 55 43 |*/.#defi|ne _GNUC|
|00001cd0| 5f 4d 41 47 49 43 20 20 | 20 20 20 30 78 34 37 34 |_MAGIC | 0x474|
|00001ce0| 45 35 35 34 33 4c 20 2f | 2a 20 22 47 4e 55 43 22 |E5543L /|* "GNUC"|
|00001cf0| 20 2a 2f 0a 23 64 65 66 | 69 6e 65 20 5f 4a 4d 50 | */.#def|ine _JMP|
|00001d00| 5f 4f 50 43 4f 44 45 20 | 20 20 20 20 30 78 34 45 |_OPCODE | 0x4E|
|00001d10| 46 39 0a 23 64 65 66 69 | 6e 65 20 5f 54 49 4d 45 |F9.#defi|ne _TIME|
|00001d20| 5f 56 45 43 20 20 20 20 | 20 20 20 30 78 31 30 30 |_VEC | 0x100|
|00001d30| 0a 0a 73 74 72 75 63 74 | 20 5f 5f 78 62 72 61 20 |..struct| __xbra |
|00001d40| 7b 0a 20 20 20 6c 6f 6e | 67 20 20 20 20 20 20 20 |{. lon|g |
|00001d50| 20 20 20 20 20 20 78 62 | 72 61 5f 6d 61 67 69 63 | xb|ra_magic|
|00001d60| 3b 0a 20 20 20 6c 6f 6e | 67 20 20 20 20 20 20 20 |;. lon|g |
|00001d70| 20 20 20 20 20 20 67 6e | 75 5f 6d 61 67 69 63 3b | gn|u_magic;|
|00001d80| 0a 20 20 20 76 6f 69 64 | 20 20 20 20 20 20 20 20 |. void| |
|00001d90| 20 20 20 20 20 28 2a 6e | 65 78 74 29 28 29 3b 0a | (*n|ext)();.|
|00001da0| 20 20 20 73 68 6f 72 74 | 20 20 20 20 20 20 20 20 | short| |
|00001db0| 20 20 20 20 6a 75 6d 70 | 3b 0a 20 20 20 76 6f 69 | jump|;. voi|
|00001dc0| 64 20 20 20 20 20 20 20 | 20 20 20 20 20 20 28 2a |d | (*|
|00001dd0| 68 61 6e 64 6c 65 72 5f | 61 64 64 72 65 73 73 29 |handler_|address)|
|00001de0| 28 29 3b 0a 7d 20 78 62 | 72 61 20 3d 20 7b 20 5f |();.} xb|ra = { _|
|00001df0| 58 42 52 41 5f 4d 41 47 | 49 43 2c 20 20 2f 2a 20 |XBRA_MAG|IC, /* |
|00001e00| 58 42 52 41 20 6d 61 67 | 69 63 20 20 20 20 20 20 |XBRA mag|ic |
|00001e10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2a | | *|
|00001e20| 2f 0a 20 20 20 20 20 20 | 20 20 20 20 20 5f 47 4e |/. | _GN|
|00001e30| 55 43 5f 4d 41 47 49 43 | 2c 20 20 2f 2a 20 61 70 |UC_MAGIC|, /* ap|
|00001e40| 70 6c 69 63 61 74 69 6f | 6e 20 6d 61 67 69 63 20 |plicatio|n magic |
|00001e50| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2a 2f 0a | | */.|
|00001e60| 20 20 20 20 20 20 20 20 | 20 20 20 30 4c 2c 20 20 | | 0L, |
|00001e70| 20 20 20 20 20 20 20 20 | 20 2f 2a 20 70 6f 69 6e | | /* poin|
|00001e80| 74 65 72 20 74 6f 20 6e | 65 78 74 20 68 61 6e 64 |ter to n|ext hand|
|00001e90| 6c 65 72 20 20 20 20 20 | 20 20 20 2a 2f 0a 20 20 |ler | */. |
|00001ea0| 20 20 20 20 20 20 20 20 | 20 5f 4a 4d 50 5f 4f 50 | | _JMP_OP|
|00001eb0| 43 4f 44 45 2c 20 20 2f | 2a 20 6a 75 6d 70 20 69 |CODE, /|* jump i|
|00001ec0| 6e 73 74 72 75 63 74 69 | 6f 6e 20 20 20 20 20 20 |nstructi|on |
|00001ed0| 20 20 20 20 20 20 20 20 | 20 2a 2f 0a 20 20 20 20 | | */. |
|00001ee0| 20 20 20 20 20 20 20 6d | 79 5f 68 61 6e 64 6c 65 | m|y_handle|
|00001ef0| 72 20 20 20 20 2f 2a 20 | 61 64 64 72 65 73 73 20 |r /* |address |
|00001f00| 6f 66 20 6f 75 72 20 68 | 61 6e 64 6c 65 72 20 72 |of our h|andler r|
|00001f10| 6f 75 74 69 6e 65 20 2a | 2f 0a 20 20 20 20 20 20 |outine *|/. |
|00001f20| 20 20 20 7d 3b 0a 0a 76 | 6f 69 64 20 69 6e 73 74 | };..v|oid inst|
|00001f30| 61 6c 6c 5f 68 61 6e 64 | 6c 65 72 28 29 0a 7b 0a |all_hand|ler().{.|
|00001f40| 20 20 20 20 78 62 72 61 | 2e 6e 65 78 74 20 3d 20 | xbra|.next = |
|00001f50| 53 65 74 65 78 63 28 5f | 54 49 4d 45 5f 56 45 43 |Setexc(_|TIME_VEC|
|00001f60| 2c 20 26 78 62 72 61 2e | 6a 75 6d 70 29 3b 0a 20 |, &xbra.|jump);. |
|00001f70| 20 20 20 2f 2a 0a 20 20 | 20 20 20 2a 20 53 65 74 | /*. | * Set|
|00001f80| 65 78 63 20 72 65 74 75 | 72 6e 73 20 74 68 65 20 |exc retu|rns the |
|00001f90| 61 64 64 72 65 73 73 20 | 6f 66 20 74 68 65 20 6f |address |of the o|
|00001fa0| 6c 64 20 68 61 6e 64 6c | 65 72 20 74 68 61 74 20 |ld handl|er that |
|00001fb0| 77 65 20 73 74 61 73 68 | 0a 20 20 20 20 20 2a 20 |we stash|. * |
|00001fc0| 61 77 61 79 20 69 6e 20 | 78 62 72 61 2e 6e 65 78 |away in |xbra.nex|
|00001fd0| 74 2e 20 49 6e 20 69 74 | 73 20 70 6c 61 63 65 20 |t. In it|s place |
|00001fe0| 77 65 20 70 75 74 20 74 | 68 65 20 61 64 64 72 65 |we put t|he addre|
|00001ff0| 73 73 20 6f 66 20 74 68 | 65 0a 20 20 20 20 20 2a |ss of th|e. *|
|00002000| 20 6a 75 6d 70 20 69 6e | 73 74 72 75 63 74 69 6f | jump in|structio|
|00002010| 6e 20 69 6e 20 74 68 65 | 20 58 42 52 41 20 73 74 |n in the| XBRA st|
|00002020| 72 75 63 74 75 72 65 2e | 20 57 68 65 6e 20 74 68 |ructure.| When th|
|00002030| 65 20 70 72 6f 63 65 73 | 73 6f 72 0a 20 20 20 20 |e proces|sor. |
|00002040| 20 2a 20 70 69 63 6b 73 | 20 75 70 20 74 68 69 73 | * picks| up this|
|00002050| 20 61 64 64 72 65 73 73 | 2c 20 69 74 20 65 78 65 | address|, it exe|
|00002060| 63 75 74 65 73 20 74 68 | 65 20 6a 75 6d 70 20 69 |cutes th|e jump i|
|00002070| 6e 73 74 72 75 63 74 69 | 6f 6e 20 74 6f 0a 20 20 |nstructi|on to. |
|00002080| 20 20 20 2a 20 74 68 65 | 20 65 6e 74 72 79 20 70 | * the| entry p|
|00002090| 6f 69 6e 74 20 6f 66 20 | 6f 75 72 20 68 61 6e 64 |oint of |our hand|
|000020a0| 6c 65 72 20 66 75 6e 63 | 74 69 6f 6e 2e 0a 20 20 |ler func|tion.. |
|000020b0| 20 20 20 2a 2f 0a 7d 0a | 5c 65 6e 64 7b 76 65 72 | */.}.|\end{ver|
|000020c0| 62 61 74 69 6d 7d 7d 0a | 0a 41 66 74 65 72 20 6f |batim}}.|.After o|
|000020d0| 75 72 20 68 61 6e 64 6c | 65 72 20 69 73 20 69 6e |ur handl|er is in|
|000020e0| 73 74 61 6c 6c 65 64 2c | 20 77 68 65 6e 20 74 68 |stalled,| when th|
|000020f0| 65 20 65 78 63 65 70 74 | 69 6f 6e 20 6f 63 63 75 |e except|ion occu|
|00002100| 72 73 20 69 74 20 66 69 | 6e 61 6c 6c 79 0a 67 65 |rs it fi|nally.ge|
|00002110| 74 73 20 63 6f 6e 74 72 | 6f 6c 2e 20 49 74 20 6d |ts contr|ol. It m|
|00002120| 75 73 74 20 64 6f 20 77 | 68 61 74 20 69 74 20 6e |ust do w|hat it n|
|00002130| 65 65 64 73 20 74 6f 2c | 20 74 68 65 6e 20 62 72 |eeds to,| then br|
|00002140| 61 6e 63 68 20 74 6f 20 | 74 68 65 20 6e 65 78 74 |anch to |the next|
|00002150| 0a 65 78 63 65 70 74 69 | 6f 6e 20 68 61 6e 64 6c |.excepti|on handl|
|00002160| 65 72 20 69 6e 20 74 68 | 65 20 63 68 61 69 6e 20 |er in th|e chain |
|00002170| 28 61 66 74 65 72 20 69 | 74 20 68 61 73 20 63 6c |(after i|t has cl|
|00002180| 65 61 6e 65 64 20 75 70 | 20 61 6e 79 74 68 69 6e |eaned up| anythin|
|00002190| 67 20 69 74 0a 70 75 74 | 20 6f 6e 20 74 68 65 20 |g it.put| on the |
|000021a0| 73 74 61 63 6b 29 5c 66 | 6f 6f 74 6e 6f 74 65 7b |stack)\f|ootnote{|
|000021b0| 47 4e 55 43 20 75 73 65 | 72 73 20 77 69 6c 6c 20 |GNUC use|rs will |
|000021c0| 68 61 76 65 20 74 6f 20 | 62 65 20 63 61 72 65 66 |have to |be caref|
|000021d0| 75 6c 20 69 66 20 75 73 | 69 6e 67 20 74 68 65 0a |ul if us|ing the.|
|000021e0| 5c 6d 62 6f 78 7b 2d 66 | 6f 6d 69 74 2d 66 72 61 |\mbox{-f|omit-fra|
|000021f0| 6d 65 2d 70 6f 69 6e 74 | 65 72 7d 20 6f 70 74 69 |me-point|er} opti|
|00002200| 6f 6e 2e 7d 2e 20 20 50 | 6c 65 61 73 65 20 6e 6f |on.}. P|lease no|
|00002210| 74 65 20 74 68 61 74 20 | 61 20 70 69 65 63 65 0a |te that |a piece.|
|00002220| 6f 66 20 61 6e 20 61 73 | 73 65 6d 62 6c 65 72 20 |of an as|sembler |
|00002230| 63 6f 64 65 20 69 6e 20 | 74 68 65 20 65 78 61 6d |code in |the exam|
|00002240| 70 6c 65 20 62 65 6c 6f | 77 20 69 73 20 75 73 69 |ple belo|w is usi|
|00002250| 6e 67 20 67 63 63 20 73 | 79 6e 74 61 78 2e 0a 41 |ng gcc s|yntax..A|
|00002260| 20 6b 65 79 77 6f 72 64 | 20 7b 5c 74 74 20 76 6f | keyword| {\tt vo|
|00002270| 6c 61 74 69 6c 65 7d 20 | 69 73 20 6e 65 65 64 65 |latile} |is neede|
|00002280| 64 20 61 73 20 61 20 67 | 75 61 72 64 20 61 67 61 |d as a g|uard aga|
|00002290| 69 6e 73 74 20 61 6e 20 | 6f 76 65 72 7a 65 61 6c |inst an |overzeal|
|000022a0| 6f 75 73 0a 6f 70 74 69 | 6d 69 7a 65 72 2e 0a 0a |ous.opti|mizer...|
|000022b0| 7b 5c 73 6d 61 6c 6c 25 | 0a 5c 62 65 67 69 6e 7b |{\small%|.\begin{|
|000022c0| 76 65 72 62 61 74 69 6d | 7d 0a 76 6f 69 64 20 6d |verbatim|}.void m|
|000022d0| 79 5f 68 61 6e 64 6c 65 | 72 28 29 0a 7b 0a 20 20 |y_handle|r().{. |
|000022e0| 2f 2a 20 6d 79 20 68 61 | 6e 64 6c 65 72 20 63 6f |/* my ha|ndler co|
|000022f0| 64 65 20 67 6f 65 73 20 | 68 65 72 65 20 2a 2f 0a |de goes |here */.|
|00002300| 20 20 5f 5f 61 73 6d 5f | 5f 20 76 6f 6c 61 74 69 | __asm_|_ volati|
|00002310| 6c 65 28 22 75 6e 6c 6b | 20 61 36 20 20 20 20 20 |le("unlk| a6 |
|00002320| 20 20 20 20 20 2f 2a 20 | 63 6c 65 61 6e 20 75 70 | /* |clean up|
|00002330| 20 73 74 61 63 6b 20 2a | 2f 0a 20 20 20 20 20 20 | stack *|/. |
|00002340| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 6d 6f | | mo|
|00002350| 76 6c 20 5f 78 62 72 61 | 2b 38 2c 20 61 30 20 2f |vl _xbra|+8, a0 /|
|00002360| 2a 20 61 64 64 72 65 73 | 73 20 6f 66 20 6e 65 78 |* addres|s of nex|
|00002370| 74 20 68 61 6e 64 6c 65 | 72 20 69 6e 20 41 30 20 |t handle|r in A0 |
|00002380| 2a 2f 0a 7d 20 20 20 20 | 20 20 20 20 20 20 20 20 |*/.} | |
|00002390| 20 20 20 20 20 20 20 6a | 6d 70 20 20 61 30 40 22 | j|mp a0@"|
|000023a0| 29 3b 20 20 20 20 20 20 | 2f 2a 20 6a 75 6d 70 20 |); |/* jump |
|000023b0| 74 6f 20 69 74 20 2a 2f | 0a 5c 65 6e 64 7b 76 65 |to it */|.\end{ve|
|000023c0| 72 62 61 74 69 6d 7d 7d | 0a 0a 54 6f 20 75 6e 6c |rbatim}}|..To unl|
|000023d0| 69 6e 6b 20 6f 75 72 20 | 68 61 6e 64 6c 65 72 20 |ink our |handler |
|000023e0| 66 72 6f 6d 20 74 68 65 | 20 65 78 63 65 70 74 69 |from the| excepti|
|000023f0| 6f 6e 20 63 68 61 69 6e | 20 77 65 20 66 69 72 73 |on chain| we firs|
|00002400| 74 20 6e 65 65 64 20 74 | 6f 0a 6c 6f 63 61 74 65 |t need t|o.locate|
|00002410| 20 69 74 20 69 6e 20 6d | 65 6d 6f 72 79 2c 20 61 | it in m|emory, a|
|00002420| 6e 64 20 74 68 65 6e 20 | 6d 61 6b 65 20 69 74 73 |nd then |make its|
|00002430| 20 70 72 65 64 65 63 65 | 73 73 6f 72 20 70 6f 69 | predece|ssor poi|
|00002440| 6e 74 20 74 6f 20 69 74 | 73 0a 73 75 63 63 65 73 |nt to it|s.succes|
|00002450| 73 6f 72 2e 20 54 68 69 | 73 20 69 73 20 77 68 65 |sor. Thi|s is whe|
|00002460| 72 65 20 74 68 65 20 58 | 42 52 41 20 70 72 6f 74 |re the X|BRA prot|
|00002470| 6f 63 6f 6c 20 72 65 61 | 6c 6c 79 20 63 6f 6d 65 |ocol rea|lly come|
|00002480| 73 20 69 6e 74 6f 20 69 | 74 73 20 6f 77 6e 2e 0a |s into i|ts own..|
|00002490| 57 65 20 62 65 67 69 6e | 20 74 68 65 20 73 65 61 |We begin| the sea|
|000024a0| 72 63 68 20 61 74 20 74 | 68 65 20 65 78 63 65 70 |rch at t|he excep|
|000024b0| 74 69 6f 6e 20 76 65 63 | 74 6f 72 20 6c 6f 6f 6b |tion vec|tor look|
|000024c0| 69 6e 67 20 66 6f 72 20 | 6f 75 72 20 58 42 52 41 |ing for |our XBRA|
|000024d0| 0a 65 6c 65 6d 65 6e 74 | 73 20 61 64 64 72 65 73 |.element|s addres|
|000024e0| 73 2e 20 49 66 20 6f 75 | 72 20 61 64 64 72 65 73 |s. If ou|r addres|
|000024f0| 73 20 69 73 20 66 6f 75 | 6e 64 20 77 65 20 61 75 |s is fou|nd we au|
|00002500| 74 68 65 6e 74 69 63 61 | 74 65 20 69 74 0a 62 79 |thentica|te it.by|
|00002510| 20 74 65 73 74 69 6e 67 | 20 74 68 65 20 74 77 6f | testing| the two|
|00002520| 20 6d 61 67 69 63 20 6e | 75 6d 62 65 72 73 2e 20 | magic n|umbers. |
|00002530| 4f 74 68 65 72 77 69 73 | 65 0a 77 65 20 74 72 61 |Otherwis|e.we tra|
|00002540| 76 65 6c 20 64 6f 77 6e | 20 74 68 65 20 63 68 61 |vel down| the cha|
|00002550| 69 6e 20 62 79 20 66 6f | 6c 6c 6f 77 69 6e 67 20 |in by fo|llowing |
|00002560| 74 68 65 20 58 42 52 41 | 20 65 6c 65 6d 65 6e 74 |the XBRA| element|
|00002570| 73 0a 7b 5c 74 74 20 6e | 65 78 74 7d 20 70 6f 69 |s.{\tt n|ext} poi|
|00002580| 6e 74 65 72 2e 0a 0a 0a | 7b 5c 73 6d 61 6c 6c 25 |nter....|{\small%|
|00002590| 0a 5c 62 65 67 69 6e 7b | 76 65 72 62 61 74 69 6d |.\begin{|verbatim|
|000025a0| 7d 0a 2f 2a 0a 20 2a 20 | 75 6e 6c 69 6e 6b 20 61 |}./*. * |unlink a|
|000025b0| 20 68 61 6e 64 6c 65 72 | 20 69 6e 20 61 20 78 62 | handler| in a xb|
|000025c0| 72 61 20 66 72 69 65 6e | 64 6c 79 20 6d 61 6e 6e |ra frien|dly mann|
|000025d0| 65 72 20 66 72 6f 6d 20 | 74 68 65 20 65 78 63 20 |er from |the exc |
|000025e0| 63 68 61 69 6e 0a 20 2a | 2f 0a 73 74 61 74 69 63 |chain. *|/.static|
|000025f0| 20 76 6f 69 64 20 75 6e | 6c 69 6e 6b 5f 68 61 6e | void un|link_han|
|00002600| 64 6c 65 72 28 6d 65 2c | 20 65 78 63 29 0a 78 62 |dler(me,| exc).xb|
|00002610| 72 61 5f 73 74 72 75 63 | 74 20 2a 6d 65 3b 0a 69 |ra_struc|t *me;.i|
|00002620| 6e 74 20 65 78 63 3b 0a | 7b 0a 20 20 20 20 78 62 |nt exc;.|{. xb|
|00002630| 72 61 5f 73 74 72 75 63 | 74 20 2a 74 68 69 73 2c |ra_struc|t *this,|
|00002640| 20 2a 70 72 65 76 3b 0a | 20 20 20 20 6c 6f 6e 67 | *prev;.| long|
|00002650| 20 73 61 76 65 5f 73 73 | 70 3b 0a 20 20 20 20 0a | save_ss|p;. .|
|00002660| 20 20 20 20 74 68 69 73 | 20 3d 20 28 78 62 72 61 | this| = (xbra|
|00002670| 5f 73 74 72 75 63 74 20 | 2a 29 20 20 20 20 20 20 |_struct |*) |
|00002680| 2f 2a 20 67 65 74 20 68 | 65 61 64 20 6f 66 20 63 |/* get h|ead of c|
|00002690| 68 61 69 6e 20 2a 2f 0a | 20 20 20 20 20 20 20 20 |hain */.| |
|000026a0| 28 28 75 6e 73 69 67 6e | 65 64 20 6c 6f 6e 67 29 |((unsign|ed long)|
|000026b0| 53 65 74 65 78 63 28 65 | 78 63 2c 20 2d 31 4c 29 |Setexc(e|xc, -1L)|
|000026c0| 20 2d 20 6f 66 66 73 65 | 74 6f 66 28 78 62 72 61 | - offse|tof(xbra|
|000026d0| 5f 73 74 72 75 63 74 2c | 20 6a 75 6d 70 29 29 3b |_struct,| jump));|
|000026e0| 0a 20 20 20 20 69 66 28 | 74 68 69 73 20 3d 3d 20 |. if(|this == |
|000026f0| 6d 65 29 0a 20 20 20 20 | 7b 20 20 20 2f 2a 20 61 |me). |{ /* a|
|00002700| 74 20 74 68 65 20 68 65 | 61 64 2c 20 6a 75 73 74 |t the he|ad, just|
|00002710| 20 75 6e 6c 69 6e 6b 20 | 2a 2f 0a 20 20 20 20 20 | unlink |*/. |
|00002720| 20 20 20 53 65 74 65 78 | 63 28 65 78 63 2c 20 6d | Setex|c(exc, m|
|00002730| 65 2d 3e 6e 65 78 74 29 | 3b 0a 20 20 20 20 20 20 |e->next)|;. |
|00002740| 20 20 72 65 74 75 72 6e | 3b 0a 20 20 20 20 7d 0a | return|;. }.|
|00002750| 20 20 20 20 2f 2a 20 6f | 74 68 65 72 77 69 73 65 | /* o|therwise|
|00002760| 20 66 69 6e 64 20 6d 65 | 20 69 6e 20 74 68 65 20 | find me| in the |
|00002770| 63 68 61 69 6e 20 61 6e | 64 20 75 6e 6c 69 6e 6b |chain an|d unlink|
|00002780| 20 2a 2f 0a 20 20 20 20 | 73 61 76 65 5f 73 73 70 | */. |save_ssp|
|00002790| 20 3d 20 53 75 70 65 72 | 28 30 4c 29 3b 0a 20 20 | = Super|(0L);. |
|000027a0| 20 20 66 6f 72 28 70 72 | 65 76 20 3d 20 74 68 69 | for(pr|ev = thi|
|000027b0| 73 3b 20 74 68 69 73 20 | 26 26 20 28 74 68 69 73 |s; this |&& (this|
|000027c0| 20 21 3d 20 6d 65 29 3b | 20 70 72 65 76 20 3d 20 | != me);| prev = |
|000027d0| 74 68 69 73 2c 0a 20 20 | 20 20 20 20 20 20 74 68 |this,. | th|
|000027e0| 69 73 20 3d 20 28 78 62 | 72 61 5f 73 74 72 75 63 |is = (xb|ra_struc|
|000027f0| 74 20 2a 29 28 28 74 68 | 69 73 2d 3e 6e 65 78 74 |t *)((th|is->next|
|00002800| 29 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 3f |). | ?|
|00002810| 20 28 28 28 63 68 61 72 | 20 2a 29 28 74 68 69 73 | (((char| *)(this|
|00002820| 2d 3e 6e 65 78 74 29 29 | 20 2d 20 6f 66 66 73 65 |->next))| - offse|
|00002830| 74 6f 66 28 78 62 72 61 | 5f 73 74 72 75 63 74 2c |tof(xbra|_struct,|
|00002840| 20 6a 75 6d 70 29 29 20 | 3a 20 30 29 29 0a 20 20 | jump)) |: 0)). |
|00002850| 20 20 7b 0a 20 20 20 20 | 20 20 20 20 2f 2a 20 76 | {. | /* v|
|00002860| 61 6c 69 64 61 74 65 20 | 74 68 65 20 78 62 72 61 |alidate |the xbra|
|00002870| 20 2a 2f 0a 20 20 20 20 | 20 20 20 20 69 66 28 74 | */. | if(t|
|00002880| 68 69 73 2d 3e 78 62 72 | 61 5f 6d 61 67 69 63 20 |his->xbr|a_magic |
|00002890| 21 3d 20 5f 58 42 52 41 | 5f 4d 41 47 49 43 29 20 |!= _XBRA|_MAGIC) |
|000028a0| 0a 20 20 20 20 20 20 20 | 20 7b 20 20 20 20 20 20 |. | { |
|000028b0| 20 2f 2a 20 61 20 6e 6f | 6e 20 58 42 52 41 20 68 | /* a no|n XBRA h|
|000028c0| 61 6e 64 6c 65 72 20 69 | 6e 20 74 68 65 20 63 68 |andler i|n the ch|
|000028d0| 61 69 6e 20 2d 2d 20 73 | 68 61 6d 65 20 6f 6e 20 |ain -- s|hame on |
|000028e0| 79 6f 75 20 2a 2f 0a 20 | 20 20 20 20 20 20 20 20 |you */. | |
|000028f0| 20 20 20 53 75 70 65 72 | 28 73 61 76 65 5f 73 73 | Super|(save_ss|
|00002900| 70 29 3b 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |p);. | |
|00002910| 53 65 74 65 78 63 28 65 | 78 63 2c 20 6d 65 2d 3e |Setexc(e|xc, me->|
|00002920| 6e 65 78 74 29 3b 20 2f | 2a 20 6e 75 6b 65 20 69 |next); /|* nuke i|
|00002930| 74 2c 20 6f 74 68 65 72 | 77 69 73 65 20 69 74 20 |t, other|wise it |
|00002940| 6d 61 79 20 63 61 6c 6c | 20 4d 45 20 2a 2f 0a 20 |may call| ME */. |
|00002950| 20 20 20 20 20 20 20 20 | 20 20 20 72 65 74 75 72 | | retur|
|00002960| 6e 3b 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |n; | |
|00002970| 20 20 2f 2a 20 61 66 74 | 65 72 20 49 20 61 6d 20 | /* aft|er I am |
|00002980| 64 65 69 6e 73 74 61 6c | 6c 65 64 20 2a 2f 0a 20 |deinstal|led */. |
|00002990| 20 20 20 20 20 20 20 7d | 0a 20 20 20 20 7d 0a 20 | }|. }. |
|000029a0| 20 20 20 0a 20 20 20 20 | 69 66 28 20 28 74 68 69 | . |if( (thi|
|000029b0| 73 20 3d 3d 20 6d 65 29 | 20 26 26 20 28 74 68 69 |s == me)| && (thi|
|000029c0| 73 2d 3e 67 6e 75 63 5f | 6d 61 67 69 63 20 3d 3d |s->gnuc_|magic ==|
|000029d0| 20 5f 47 4e 55 43 5f 4d | 41 47 49 43 29 20 29 0a | _GNUC_M|AGIC) ).|
|000029e0| 20 20 20 20 7b 20 20 20 | 2f 2a 20 75 6e 6c 69 6e | { |/* unlin|
|000029f0| 6b 20 6d 65 20 66 72 6f | 6d 20 6d 69 64 64 6c 65 |k me fro|m middle|
|00002a00| 20 6f 66 20 74 68 65 20 | 63 68 61 69 6e 20 2a 2f | of the |chain */|
|00002a10| 0a 20 20 20 20 20 20 20 | 20 70 72 65 76 2d 3e 6e |. | prev->n|
|00002a20| 65 78 74 20 3d 20 74 68 | 69 73 2d 3e 6e 65 78 74 |ext = th|is->next|
|00002a30| 3b 0a 20 20 20 20 20 20 | 20 20 53 75 70 65 72 28 |;. | Super(|
|00002a40| 73 61 76 65 5f 73 73 70 | 29 3b 0a 20 20 20 20 20 |save_ssp|);. |
|00002a50| 20 20 20 72 65 74 75 72 | 6e 3b 0a 20 20 20 20 7d | retur|n;. }|
|00002a60| 0a 20 20 20 20 2f 2a 20 | 77 65 20 61 72 65 20 73 |. /* |we are s|
|00002a70| 63 72 65 77 65 64 20 2a | 2f 0a 20 20 20 20 53 75 |crewed *|/. Su|
|00002a80| 70 65 72 28 73 61 76 65 | 5f 73 73 70 29 3b 0a 20 |per(save|_ssp);. |
|00002a90| 20 20 20 43 63 6f 6e 77 | 73 28 22 5c 72 5c 6e 48 | Cconw|s("\r\nH|
|00002aa0| 61 6e 64 6c 65 72 20 6e | 6f 74 20 66 6f 75 6e 64 |andler n|ot found|
|00002ab0| 21 5c 72 5c 6e 5c 6e 22 | 29 3b 0a 7d 0a 0a 2f 2a |!\r\n\n"|);.}../*|
|00002ac0| 20 74 68 69 73 20 72 6f | 75 74 69 6e 65 20 6d 61 | this ro|utine ma|
|00002ad0| 79 20 62 65 20 63 61 6c | 6c 65 64 20 61 73 20 75 |y be cal|led as u|
|00002ae0| 6e 6c 69 6e 6b 5f 68 61 | 6e 64 6c 65 72 28 26 78 |nlink_ha|ndler(&x|
|00002af0| 62 72 61 2c 20 5f 54 49 | 4d 45 5f 56 45 43 29 20 |bra, _TI|ME_VEC) |
|00002b00| 2a 2f 0a 5c 65 6e 64 7b | 76 65 72 62 61 74 69 6d |*/.\end{|verbatim|
|00002b10| 7d 7d 0a 0a 5c 73 65 63 | 74 69 6f 6e 7b 52 65 67 |}}..\sec|tion{Reg|
|00002b20| 69 73 74 65 72 69 6e 67 | 20 79 6f 75 72 20 58 42 |istering| your XB|
|00002b30| 52 41 7d 0a 54 6f 20 62 | 65 20 66 75 6c 6c 79 20 |RA}.To b|e fully |
|00002b40| 58 42 52 41 20 63 6f 6d | 70 61 74 69 62 6c 65 2c |XBRA com|patible,|
|00002b50| 20 79 6f 75 72 20 75 6e | 69 71 75 65 20 58 42 52 | your un|ique XBR|
|00002b60| 41 20 69 64 20 6d 75 73 | 74 20 6d 65 65 74 20 74 |A id mus|t meet t|
|00002b70| 68 65 20 66 6f 6c 6c 6f | 77 69 6e 67 0a 63 72 69 |he follo|wing.cri|
|00002b80| 74 65 72 69 61 3a 0a 5c | 62 65 67 69 6e 7b 69 74 |teria:.\|begin{it|
|00002b90| 65 6d 69 7a 65 7d 0a 20 | 20 5c 69 74 65 6d 20 54 |emize}. | \item T|
|00002ba0| 68 65 20 69 64 20 73 68 | 6f 75 6c 64 20 63 6f 6e |he id sh|ould con|
|00002bb0| 74 61 69 6e 20 6f 6e 6c | 79 20 70 72 69 6e 74 61 |tain onl|y printa|
|00002bc0| 62 6c 65 20 41 53 43 49 | 49 20 63 68 61 72 61 63 |ble ASCI|I charac|
|00002bd0| 74 65 72 73 20 28 33 32 | 2e 2e 31 32 36 29 2e 0a |ters (32|..126)..|
|00002be0| 20 20 5c 69 74 65 6d 20 | 54 68 65 20 69 64 20 68 | \item |The id h|
|00002bf0| 61 73 20 74 6f 20 62 65 | 20 72 65 67 69 73 74 65 |as to be| registe|
|00002c00| 72 65 64 20 77 69 74 68 | 20 4a 75 6c 69 61 6e 20 |red with| Julian |
|00002c10| 52 65 73 63 68 6b 65 20 | 74 6f 20 65 6e 73 75 72 |Reschke |to ensur|
|00002c20| 65 20 74 68 61 74 0a 20 | 20 20 20 20 20 20 20 69 |e that. | i|
|00002c30| 74 20 69 73 20 75 6e 69 | 71 75 65 2e 20 54 6f 20 |t is uni|que. To |
|00002c40| 64 6f 20 74 68 69 73 20 | 79 6f 75 20 6e 65 65 64 |do this |you need|
|00002c50| 20 74 6f 20 73 65 6e 64 | 20 6d 61 69 6c 20 74 6f | to send| mail to|
|00002c60| 20 0a 09 5c 6d 62 6f 78 | 7b 6a 75 6c 69 61 6e 40 | ..\mbox|{julian@|
|00002c70| 6d 61 74 68 2e 75 6e 69 | 2d 6d 75 65 6e 73 74 65 |math.uni|-muenste|
|00002c80| 72 2e 64 65 7d 20 6f 72 | 20 5c 6d 62 6f 78 7b 6a |r.de} or| \mbox{j|
|00002c90| 72 40 6d 73 2e 6d 61 75 | 73 2e 64 65 7d 20 63 6f |r@ms.mau|s.de} co|
|00002ca0| 6e 74 61 69 6e 69 6e 67 | 0a 09 74 68 65 20 66 6f |ntaining|..the fo|
|00002cb0| 6c 6c 6f 77 69 6e 67 20 | 69 6e 66 6f 72 6d 61 74 |llowing |informat|
|00002cc0| 69 6f 6e 3a 0a 20 20 5c | 62 65 67 69 6e 7b 69 74 |ion:. \|begin{it|
|00002cd0| 65 6d 69 7a 65 7d 0a 09 | 20 20 5c 69 74 65 6d 20 |emize}..| \item |
|00002ce0| 54 68 65 20 66 75 6c 6c | 20 70 72 6f 67 72 61 6d |The full| program|
|00002cf0| 20 6e 61 6d 65 2e 0a 09 | 20 20 5c 69 74 65 6d 20 | name...| \item |
|00002d00| 4e 61 6d 65 20 6f 66 20 | 74 68 65 20 61 75 74 68 |Name of |the auth|
|00002d10| 6f 72 2e 0a 09 20 20 5c | 69 74 65 6d 20 58 42 52 |or... \|item XBR|
|00002d20| 41 20 69 64 2e 0a 09 20 | 20 5c 69 74 65 6d 20 50 |A id... | \item P|
|00002d30| 72 6f 67 72 61 6d 20 73 | 74 61 74 75 73 20 28 50 |rogram s|tatus (P|
|00002d40| 44 2c 20 73 68 61 72 65 | 77 61 72 65 2c 20 63 6f |D, share|ware, co|
|00002d50| 6d 6d 65 72 63 69 61 6c | 6c 79 20 61 6e 64 20 61 |mmercial|ly and a|
|00002d60| 76 61 69 6c 61 62 6c 65 | 0a 09 20 20 20 20 20 20 |vailable|.. |
|00002d70| 20 20 20 66 72 6f 6d 2e | 2e 2e 29 2e 0a 09 20 20 | from.|..)... |
|00002d80| 5c 69 74 65 6d 20 41 20 | 6c 69 73 74 20 6f 66 20 |\item A |list of |
|00002d90| 75 73 65 64 20 76 65 63 | 74 6f 72 73 2e 0a 20 20 |used vec|tors.. |
|00002da0| 5c 65 6e 64 7b 69 74 65 | 6d 69 7a 65 7d 0a 5c 65 |\end{ite|mize}.\e|
|00002db0| 6e 64 7b 69 74 65 6d 69 | 7a 65 7d 0a 49 66 20 79 |nd{itemi|ze}.If y|
|00002dc0| 6f 75 20 61 72 65 20 75 | 6e 61 62 6c 65 20 74 6f |ou are u|nable to|
|00002dd0| 20 73 65 6e 64 20 69 6e | 74 65 72 6e 65 74 20 6d | send in|ternet m|
|00002de0| 61 69 6c 2c 20 69 27 6c | 6c 20 62 65 20 67 6c 61 |ail, i'l|l be gla|
|00002df0| 64 20 74 6f 20 70 61 73 | 73 20 6f 6e 20 79 6f 75 |d to pas|s on you|
|00002e00| 72 0a 72 65 71 75 65 73 | 74 20 74 6f 20 4a 75 6c |r.reques|t to Jul|
|00002e10| 69 61 6e 2e 20 49 20 6d | 61 79 20 62 65 20 63 6f |ian. I m|ay be co|
|00002e20| 6e 74 61 63 74 65 64 20 | 6f 6e 20 47 45 6e 69 65 |ntacted |on GEnie|
|00002e30| 20 61 73 20 5c 6d 62 6f | 78 7b 4a 2e 42 61 6d 6d | as \mbo|x{J.Bamm|
|00002e40| 69 7d 0a 6f 72 20 6f 6e | 20 43 6f 6d 70 75 53 65 |i}.or on| CompuSe|
|00002e50| 72 76 65 20 61 73 20 5c | 6d 62 6f 78 7b 37 31 35 |rve as \|mbox{715|
|00002e60| 31 35 2c 31 35 35 7d 2e | 0a 0a 5c 73 65 63 74 69 |15,155}.|..\secti|
|00002e70| 6f 6e 7b 52 69 73 6b 73 | 7d 0a 54 68 65 72 65 20 |on{Risks|}.There |
|00002e80| 61 72 65 20 74 77 6f 20 | 6d 61 6a 6f 72 20 72 69 |are two |major ri|
|00002e90| 73 6b 73 20 69 6e 20 75 | 73 69 6e 67 20 74 68 65 |sks in u|sing the|
|00002ea0| 20 58 42 52 41 20 70 72 | 6f 74 6f 63 6f 6c 20 61 | XBRA pr|otocol a|
|00002eb0| 73 20 64 65 73 63 72 69 | 62 65 64 20 61 62 6f 76 |s descri|bed abov|
|00002ec0| 65 3a 0a 5c 62 65 67 69 | 6e 7b 69 74 65 6d 69 7a |e:.\begi|n{itemiz|
|00002ed0| 65 7d 0a 20 20 5c 69 74 | 65 6d 20 50 75 74 74 69 |e}. \it|em Putti|
|00002ee0| 6e 67 20 63 6f 64 65 20 | 69 6e 20 74 68 65 20 64 |ng code |in the d|
|00002ef0| 61 74 61 20 73 65 63 74 | 69 6f 6e 2e 0a 20 20 5c |ata sect|ion.. \|
|00002f00| 69 74 65 6d 20 4f 76 65 | 72 7a 65 61 6c 6f 75 73 |item Ove|rzealous|
|00002f10| 20 75 73 65 20 6f 66 20 | 76 65 63 74 6f 72 20 67 | use of |vector g|
|00002f20| 72 61 62 62 69 6e 67 2e | 0a 5c 65 6e 64 7b 69 74 |rabbing.|.\end{it|
|00002f30| 65 6d 69 7a 65 7d 0a 41 | 73 20 64 65 73 63 72 69 |emize}.A|s descri|
|00002f40| 62 65 64 20 61 62 6f 76 | 65 20 77 65 20 70 75 74 |bed abov|e we put|
|00002f50| 20 61 20 6a 75 6d 70 20 | 69 6e 73 74 72 75 63 74 | a jump |instruct|
|00002f60| 69 6f 6e 20 69 6e 20 74 | 68 65 20 58 42 52 41 20 |ion in t|he XBRA |
|00002f70| 73 74 72 75 63 74 75 72 | 65 20 74 68 61 74 20 70 |structur|e that p|
|00002f80| 6f 69 6e 74 73 0a 74 6f | 20 6f 75 72 20 65 78 63 |oints.to| our exc|
|00002f90| 65 70 74 69 6f 6e 20 68 | 61 6e 64 6c 65 72 2e 20 |eption h|andler. |
|00002fa0| 4e 6f 72 6d 61 6c 6c 79 | 2c 20 43 20 63 6f 6d 70 |Normally|, C comp|
|00002fb0| 69 6c 65 72 73 20 77 69 | 6c 6c 20 61 6c 6c 6f 63 |ilers wi|ll alloc|
|00002fc0| 61 74 65 20 74 68 69 73 | 20 73 74 72 75 63 74 75 |ate this| structu|
|00002fd0| 72 65 0a 69 6e 20 74 68 | 65 20 64 61 74 61 20 73 |re.in th|e data s|
|00002fe0| 65 63 74 69 6f 6e 2c 20 | 73 6f 20 77 68 65 6e 20 |ection, |so when |
|00002ff0| 63 6f 6e 74 72 6f 6c 20 | 69 73 20 70 61 73 73 65 |control |is passe|
|00003000| 64 20 74 6f 20 6f 75 72 | 20 68 61 6e 64 6c 65 72 |d to our| handler|
|00003010| 2c 20 61 6e 20 69 6e 73 | 74 72 75 63 74 69 6f 6e |, an ins|truction|
|00003020| 0a 77 69 6c 6c 20 62 65 | 20 66 65 74 63 68 65 64 |.will be| fetched|
|00003030| 20 66 72 6f 6d 20 74 68 | 65 20 64 61 74 61 20 73 | from th|e data s|
|00003040| 65 63 74 69 6f 6e 2e 20 | 4e 6f 72 6d 61 6c 6c 79 |ection. |Normally|
|00003050| 2c 20 74 68 69 73 20 64 | 6f 65 73 20 6e 6f 74 20 |, this d|oes not |
|00003060| 63 61 75 73 65 20 70 72 | 6f 62 6c 65 6d 73 0a 6f |cause pr|oblems.o|
|00003070| 6e 20 74 68 65 20 61 74 | 61 72 69 53 54 2f 54 54 |n the at|ariST/TT|
|00003080| 20 61 72 63 68 69 74 65 | 63 74 75 72 65 73 20 62 | archite|ctures b|
|00003090| 65 61 63 75 73 65 20 74 | 68 65 72 65 20 69 73 20 |eacuse t|here is |
|000030a0| 6e 6f 20 70 72 6f 74 65 | 63 74 69 6f 6e 2e 0a 42 |no prote|ction..B|
|000030b0| 75 74 2c 20 69 66 20 70 | 72 6f 74 65 63 74 69 6f |ut, if p|rotectio|
|000030c0| 6e 20 77 61 73 20 65 76 | 65 72 20 65 6e 66 6f 72 |n was ev|er enfor|
|000030d0| 63 65 64 20 62 79 20 54 | 4f 53 0a 77 65 20 77 6f |ced by T|OS.we wo|
|000030e0| 75 6c 64 20 62 65 20 69 | 6e 20 74 72 6f 75 62 6c |uld be i|n troubl|
|000030f0| 65 2c 20 61 6e 64 20 77 | 65 20 77 6f 75 6c 64 20 |e, and w|e would |
|00003100| 65 6e 64 20 75 70 20 77 | 69 74 68 20 61 20 73 65 |end up w|ith a se|
|00003110| 67 6d 65 6e 74 61 74 69 | 6f 6e 20 76 69 6f 6c 61 |gmentati|on viola|
|00003120| 74 69 6f 6e 20 61 73 20 | 0a 63 6f 64 65 20 77 6f |tion as |.code wo|
|00003130| 75 6c 64 20 62 65 20 66 | 65 74 63 68 65 64 20 66 |uld be f|etched f|
|00003140| 72 6f 6d 20 61 20 61 20 | 6e 6f 6e 2d 74 65 78 74 |rom a a |non-text|
|00003150| 20 73 65 63 74 69 6f 6e | 2e 20 50 75 74 74 69 6e | section|. Puttin|
|00003160| 67 20 20 74 68 65 20 58 | 42 52 41 20 73 74 72 75 |g the X|BRA stru|
|00003170| 63 74 75 72 65 0a 69 6e | 20 74 68 65 20 74 65 78 |cture.in| the tex|
|00003180| 74 20 73 65 63 74 69 6f | 6e 20 69 73 20 77 6f 72 |t sectio|n is wor|
|00003190| 73 65 2e 20 53 69 6e 63 | 65 20 77 65 20 70 61 74 |se. Sinc|e we pat|
|000031a0| 63 68 20 69 6e 20 74 68 | 65 20 6e 65 78 74 20 61 |ch in th|e next a|
|000031b0| 64 64 72 65 73 73 2c 20 | 69 74 20 77 6f 75 6c 64 |ddress, |it would|
|000031c0| 0a 62 65 20 61 6b 69 6e | 20 74 6f 20 73 65 6c 66 |.be akin| to self|
|000031d0| 20 6d 6f 64 69 66 79 69 | 6e 67 20 63 6f 64 65 2e | modifyi|ng code.|
|000031e0| 20 4f 6e 20 74 68 65 20 | 36 38 30 33 30 2f 34 30 | On the |68030/40|
|000031f0| 20 6d 61 63 68 69 6e 65 | 73 20 74 68 69 73 20 77 | machine|s this w|
|00003200| 69 6c 6c 20 6e 6f 74 20 | 77 6f 72 6b 0a 69 66 20 |ill not |work.if |
|00003210| 74 68 65 20 69 6e 73 74 | 72 75 63 74 69 6f 6e 20 |the inst|ruction |
|00003220| 63 61 63 68 65 20 69 73 | 20 72 65 61 64 2d 6f 6e |cache is| read-on|
|00003230| 6c 79 2e 20 46 6f 72 20 | 6e 6f 77 2c 20 70 75 74 |ly. For |now, put|
|00003240| 74 69 6e 67 20 74 68 65 | 20 68 65 61 64 65 72 20 |ting the| header |
|00003250| 69 6e 20 74 68 65 20 64 | 61 74 61 0a 73 65 63 74 |in the d|ata.sect|
|00003260| 69 6f 6e 20 73 65 65 6d | 73 20 74 6f 20 62 65 20 |ion seem|s to be |
|00003270| 74 68 65 20 6d 6f 73 74 | 20 72 65 61 73 6f 6e 61 |the most| reasona|
|00003280| 62 6c 65 20 61 6e 64 20 | 70 6f 72 74 61 62 6c 65 |ble and |portable|
|00003290| 20 73 6f 6c 75 74 69 6f | 6e 2e 20 42 75 74 20 62 | solutio|n. But b|
|000032a0| 65 20 61 77 61 72 65 0a | 74 68 61 74 20 6f 6e 20 |e aware.|that on |
|000032b0| 74 68 65 20 30 33 30 2f | 30 34 30 20 79 6f 75 20 |the 030/|040 you |
|000032c0| 6d 61 79 20 68 61 76 65 | 20 74 6f 20 66 6f 72 63 |may have| to forc|
|000032d0| 65 20 61 20 63 61 63 68 | 65 20 66 6c 75 73 68 20 |e a cach|e flush |
|000032e0| 61 66 74 65 72 20 63 68 | 61 6e 67 69 6e 67 20 63 |after ch|anging c|
|000032f0| 6f 6e 74 65 6e 74 73 0a | 74 6f 20 70 61 74 63 68 |ontents.|to patch|
|00003300| 20 74 68 65 20 6e 65 78 | 74 20 61 64 64 72 65 73 | the nex|t addres|
|00003310| 73 2c 20 6f 74 68 65 72 | 77 69 73 65 20 74 68 65 |s, other|wise the|
|00003320| 20 73 79 73 74 65 6d 20 | 77 69 6c 6c 20 63 72 61 | system |will cra|
|00003330| 73 68 2e 0a 0a 4f 6e 20 | 74 68 65 20 73 75 62 6a |sh...On |the subj|
|00003340| 65 63 74 20 6f 66 20 6f | 76 65 72 7a 65 61 6c 6f |ect of o|verzealo|
|00003350| 75 73 20 75 73 65 61 67 | 65 20 6f 66 20 58 42 52 |us useag|e of XBR|
|00003360| 41 20 41 6c 6c 61 6e 20 | 50 72 61 74 74 20 68 61 |A Allan |Pratt ha|
|00003370| 64 20 74 68 65 20 66 6f | 6c 6c 6f 77 69 6e 67 20 |d the fo|llowing |
|00003380| 0a 77 6f 72 64 73 20 6f | 66 20 61 64 76 69 73 65 |.words o|f advise|
|00003390| 3a 5c 5c 0a 60 60 49 74 | 27 73 20 6a 75 73 74 20 |:\\.``It|'s just |
|000033a0| 74 68 61 74 20 49 20 77 | 6f 75 6c 64 20 68 61 76 |that I w|ould hav|
|000033b0| 65 20 62 69 67 20 62 61 | 6e 6e 65 72 73 20 61 6c |e big ba|nners al|
|000033c0| 6c 20 6f 76 65 72 20 69 | 74 20 73 61 79 69 6e 67 |l over i|t saying|
|000033d0| 20 74 68 61 74 0a 76 65 | 63 74 6f 72 20 73 74 65 | that.ve|ctor ste|
|000033e0| 61 6c 69 6e 67 20 69 73 | 20 61 20 62 61 64 20 69 |aling is| a bad i|
|000033f0| 64 65 61 20 69 6e 20 74 | 68 65 20 66 69 72 73 74 |dea in t|he first|
|00003400| 20 70 6c 61 63 65 2e 20 | 20 54 68 65 72 65 20 61 | place. | There a|
|00003410| 72 65 0a 6a 75 73 74 20 | 61 20 66 65 77 20 76 65 |re.just |a few ve|
|00003420| 63 74 6f 72 73 20 74 68 | 61 74 20 79 6f 75 20 63 |ctors th|at you c|
|00003430| 61 6e 20 6c 65 67 61 6c | 6c 79 20 73 74 65 61 6c |an legal|ly steal|
|00003440| 2c 20 61 6e 64 20 61 20 | 66 65 77 20 6d 6f 72 65 |, and a |few more|
|00003450| 20 74 68 61 74 0a 79 6f | 75 20 63 61 6e 20 72 65 | that.yo|u can re|
|00003460| 61 73 6f 6e 61 62 6c 79 | 20 73 74 65 61 6c 2e 20 |asonably| steal. |
|00003470| 20 49 20 77 6f 75 6c 64 | 20 75 73 65 20 6f 6e 6c | I would| use onl|
|00003480| 79 20 6c 65 67 61 6c 20 | 76 65 63 74 6f 72 73 0a |y legal |vectors.|
|00003490| 61 6e 64 20 6c 65 67 61 | 6c 20 75 73 65 73 20 69 |and lega|l uses i|
|000034a0| 6e 20 74 68 65 20 65 78 | 61 6d 70 6c 65 73 2e 20 |n the ex|amples. |
|000034b0| 20 4f 6e 65 20 6b 69 6e | 64 20 6f 66 20 6c 65 67 | One kin|d of leg|
|000034c0| 61 6c 20 75 73 65 20 66 | 6f 72 0a 61 20 6c 65 67 |al use f|or.a leg|
|000034d0| 61 6c 20 76 65 63 74 6f | 72 20 69 73 20 61 20 52 |al vecto|r is a R|
|000034e0| 41 4d 64 69 73 6b 20 75 | 73 69 6e 67 20 68 64 76 |AMdisk u|sing hdv|
|000034f0| 5c 5f 72 77 20 28 61 6e | 64 20 5c 5f 62 70 62 20 |\_rw (an|d \_bpb |
|00003500| 61 6e 64 20 5c 5f 6d 65 | 64 69 61 63 68 29 2e 0a |and \_me|diach)..|
|00003510| 41 6c 73 6f 2c 20 74 61 | 6c 6b 20 61 62 6f 75 74 |Also, ta|lk about|
|00003520| 20 75 6e 68 6f 6f 6b 69 | 6e 67 20 76 65 63 74 6f | unhooki|ng vecto|
|00003530| 72 73 20 6e 65 65 64 73 | 20 61 20 77 68 6f 6c 65 |rs needs| a whole|
|00003540| 20 72 61 66 74 20 6f 66 | 20 77 61 72 6e 69 6e 67 | raft of| warning|
|00003550| 73 0a 61 62 6f 75 74 20 | 77 68 61 74 20 61 20 62 |s.about |what a b|
|00003560| 61 64 20 69 64 65 61 20 | 74 68 69 73 20 69 73 2e |ad idea |this is.|
|00003570| 0a 0a 54 68 65 20 72 69 | 67 68 74 20 77 61 79 20 |..The ri|ght way |
|00003580| 74 6f 20 64 6f 20 61 6c | 6d 6f 73 74 20 61 6e 79 |to do al|most any|
|00003590| 74 68 69 6e 67 20 74 68 | 61 74 20 69 6e 76 6f 6c |thing th|at invol|
|000035a0| 76 65 73 20 76 65 63 74 | 6f 72 20 73 74 65 61 6c |ves vect|or steal|
|000035b0| 69 6e 67 20 69 73 20 74 | 6f 0a 75 73 65 20 61 20 |ing is t|o.use a |
|000035c0| 54 53 52 20 69 6e 20 74 | 68 65 20 41 55 54 4f 20 |TSR in t|he AUTO |
|000035d0| 66 6f 6c 64 65 72 20 61 | 73 20 61 20 64 72 69 76 |folder a|s a driv|
|000035e0| 65 72 2c 20 61 6e 64 20 | 68 61 76 65 20 61 20 66 |er, and |have a f|
|000035f0| 6f 72 65 67 72 6f 75 6e | 64 0a 70 72 6f 67 72 61 |oregroun|d.progra|
|00003600| 6d 20 63 6f 6d 6d 75 6e | 69 63 61 74 65 20 77 69 |m commun|icate wi|
|00003610| 74 68 20 74 68 61 74 20 | 64 72 69 76 65 72 2c 20 |th that |driver, |
|00003620| 75 73 75 61 6c 6c 79 20 | 74 68 72 6f 75 67 68 20 |usually |through |
|00003630| 61 20 74 72 61 70 20 69 | 74 27 73 0a 73 74 65 61 |a trap i|t's.stea|
|00003640| 6c 69 6e 67 20 6f 72 20 | 74 68 72 6f 75 67 68 20 |ling or |through |
|00003650| 74 68 65 20 63 6f 6f 6b | 69 65 20 74 68 65 20 64 |the cook|ie the d|
|00003660| 72 69 76 65 72 20 6c 65 | 66 74 20 69 6e 20 74 68 |river le|ft in th|
|00003670| 65 20 63 6f 6f 6b 69 65 | 20 6a 61 72 2e 0a 54 68 |e cookie| jar..Th|
|00003680| 65 6e 20 74 68 65 72 65 | 27 73 20 6e 65 76 65 72 |en there|'s never|
|00003690| 20 61 20 71 75 65 73 74 | 69 6f 6e 20 6f 66 20 75 | a quest|ion of u|
|000036a0| 6e 68 6f 6f 6b 69 6e 67 | 2e 20 20 54 68 65 20 64 |nhooking|. The d|
|000036b0| 72 69 76 65 72 20 69 73 | 20 67 65 6e 65 72 61 6c |river is| general|
|000036c0| 6c 79 0a 73 6d 61 6c 6c | 20 65 6e 6f 75 67 68 20 |ly.small| enough |
|000036d0| 74 68 61 74 20 79 6f 75 | 20 64 6f 6e 27 74 20 6d |that you| don't m|
|000036e0| 69 6e 64 20 68 61 76 69 | 6e 67 20 69 74 20 61 72 |ind havi|ng it ar|
|000036f0| 6f 75 6e 64 20 65 76 65 | 6e 20 77 68 65 6e 20 79 |ound eve|n when y|
|00003700| 6f 75 27 72 65 0a 6e 6f | 74 20 75 73 69 6e 67 20 |ou're.no|t using |
|00003710| 74 68 65 20 70 72 6f 67 | 72 61 6d 20 69 6e 20 71 |the prog|ram in q|
|00003720| 75 65 73 74 69 6f 6e 2e | 0a 0a 49 20 67 75 65 73 |uestion.|..I gues|
|00003730| 73 20 49 20 77 6f 75 6c | 64 20 6a 75 73 74 20 6c |s I woul|d just l|
|00003740| 69 6b 65 20 74 6f 20 73 | 65 65 20 6d 6f 72 65 20 |ike to s|ee more |
|00003750| 69 6e 20 74 68 65 20 77 | 61 79 20 6f 66 20 63 61 |in the w|ay of ca|
|00003760| 76 65 61 74 73 2c 20 73 | 6f 20 70 65 6f 70 6c 65 |veats, s|o people|
|00003770| 0a 77 6f 6e 27 74 20 72 | 65 61 64 20 74 68 69 73 |.won't r|ead this|
|00003780| 20 64 6f 63 75 6d 65 6e | 74 20 61 6e 64 20 74 68 | documen|t and th|
|00003790| 69 6e 6b 20 74 68 61 74 | 20 76 65 63 74 6f 72 20 |ink that| vector |
|000037a0| 73 74 65 61 6c 69 6e 67 | 20 69 73 20 74 68 65 20 |stealing| is the |
|000037b0| 62 65 73 74 20 77 61 79 | 0a 74 6f 20 64 6f 20 73 |best way|.to do s|
|000037c0| 6f 6d 65 74 68 69 6e 67 | 2e 20 20 49 74 20 6f 66 |omething|. It of|
|000037d0| 74 65 6e 20 69 73 6e 27 | 74 2e 20 20 42 75 74 20 |ten isn'|t. But |
|000037e0| 74 68 61 74 27 73 20 61 | 6c 6c 20 67 72 61 76 79 |that's a|ll gravy|
|000037f0| 20 6f 6e 20 74 6f 70 20 | 6f 66 20 74 68 65 0a 61 | on top |of the.a|
|00003800| 63 74 75 61 6c 20 73 74 | 61 74 65 64 20 67 6f 61 |ctual st|ated goa|
|00003810| 6c 20 6f 66 20 74 68 65 | 20 64 6f 63 75 6d 65 6e |l of the| documen|
|00003820| 74 2c 20 77 68 69 63 68 | 20 69 73 20 74 6f 20 64 |t, which| is to d|
|00003830| 65 73 63 72 69 62 65 20 | 58 42 52 41 20 69 74 73 |escribe |XBRA its|
|00003840| 65 6c 66 2e 27 27 0a 0a | 5c 73 65 63 74 69 6f 6e |elf.''..|\section|
|00003850| 7b 43 6f 6e 63 6c 75 73 | 69 6f 6e 7d 0a 57 65 20 |{Conclus|ion}.We |
|00003860| 68 61 76 65 20 74 72 69 | 65 64 20 74 6f 20 64 6f |have tri|ed to do|
|00003870| 63 75 6d 65 6e 74 20 74 | 68 65 20 58 42 52 41 20 |cument t|he XBRA |
|00003880| 70 72 6f 74 6f 63 6f 6c | 2c 20 61 6e 64 20 74 6f |protocol|, and to|
|00003890| 20 69 6c 6c 75 73 74 72 | 61 74 65 20 69 74 73 20 | illustr|ate its |
|000038a0| 75 73 61 67 65 0a 77 69 | 74 68 20 73 6f 6d 65 20 |usage.wi|th some |
|000038b0| 74 79 70 69 63 61 6c 20 | 63 6f 64 65 20 73 65 67 |typical |code seg|
|000038c0| 6d 65 6e 74 73 2e 20 4f | 66 20 63 6f 75 72 73 65 |ments. O|f course|
|000038d0| 2c 20 79 6f 75 72 20 61 | 70 70 6c 69 63 61 74 69 |, your a|pplicati|
|000038e0| 6f 6e 20 6d 61 79 20 76 | 61 72 79 0a 69 6e 20 6d |on may v|ary.in m|
|000038f0| 61 6e 79 20 64 65 74 61 | 69 6c 73 2e 20 54 68 65 |any deta|ils. The|
|00003900| 20 58 42 52 41 20 70 72 | 6f 74 6f 63 6f 6c 20 64 | XBRA pr|otocol d|
|00003910| 6f 65 73 20 61 20 67 6f | 6f 64 20 6a 6f 62 20 6f |oes a go|od job o|
|00003920| 66 0a 72 65 6c 69 61 62 | 6c 79 20 6c 6f 63 61 74 |f.reliab|ly locat|
|00003930| 69 6e 67 20 68 61 6e 64 | 6c 65 72 73 20 69 6e 20 |ing hand|lers in |
|00003940| 61 6e 20 65 78 63 65 70 | 74 69 6f 6e 20 63 68 61 |an excep|tion cha|
|00003950| 69 6e 20 61 6e 64 20 70 | 72 6f 70 65 72 6c 79 0a |in and p|roperly.|
|00003960| 69 6e 73 74 61 6c 6c 69 | 6e 67 20 61 6e 64 20 72 |installi|ng and r|
|00003970| 65 6d 6f 76 69 6e 67 20 | 74 68 65 6d 20 66 72 6f |emoving |them fro|
|00003980| 6d 20 74 68 65 20 63 68 | 61 69 6e 2e 20 41 20 63 |m the ch|ain. A c|
|00003990| 6f 6d 70 6c 65 74 65 20 | 65 78 61 6d 70 6c 65 20 |omplete |example |
|000039a0| 69 73 0a 70 72 65 73 65 | 6e 74 65 64 20 69 6e 20 |is.prese|nted in |
|000039b0| 41 70 70 65 6e 64 69 78 | 20 41 2e 20 54 68 65 20 |Appendix| A. The |
|000039c0| 7b 5c 74 74 20 78 62 72 | 61 2e 68 7d 20 69 6e 63 |{\tt xbr|a.h} inc|
|000039d0| 6c 75 64 65 20 66 69 6c | 65 20 66 72 6f 6d 20 74 |lude fil|e from t|
|000039e0| 68 65 20 47 4e 55 43 0a | 6c 69 62 72 61 72 79 20 |he GNUC.|library |
|000039f0| 69 73 20 70 72 65 73 65 | 6e 74 65 64 20 69 6e 20 |is prese|nted in |
|00003a00| 41 70 70 65 6e 64 69 78 | 20 42 2e 0a 5c 63 6c 65 |Appendix| B..\cle|
|00003a10| 61 72 70 61 67 65 0a 5c | 61 70 70 65 6e 64 69 78 |arpage.\|appendix|
|00003a20| 0a 5c 73 65 63 74 69 6f | 6e 7b 41 20 63 6f 6d 70 |.\sectio|n{A comp|
|00003a30| 6c 65 74 65 20 65 78 61 | 6d 70 6c 65 7d 0a 7b 5c |lete exa|mple}.{\|
|00003a40| 66 6f 6f 74 6e 6f 74 65 | 73 69 7a 65 25 0a 5c 62 |footnote|size%.\b|
|00003a50| 65 67 69 6e 7b 76 65 72 | 62 61 74 69 6d 7d 0a 2f |egin{ver|batim}./|
|00003a60| 2a 0a 20 2a 20 58 42 52 | 41 20 65 78 61 6d 70 6c |*. * XBR|A exampl|
|00003a70| 65 3a 20 69 6e 73 74 61 | 6c 6c 20 61 20 68 61 6e |e: insta|ll a han|
|00003a80| 64 6c 65 72 20 75 73 69 | 6e 67 20 58 42 52 41 20 |dler usi|ng XBRA |
|00003a90| 70 72 6f 74 6f 63 6f 6c | 20 69 6e 74 6f 20 54 4f |protocol| into TO|
|00003aa0| 53 73 0a 20 2a 20 74 69 | 6d 65 72 20 68 61 6e 64 |Ss. * ti|mer hand|
|00003ab0| 6f 66 66 20 76 65 63 74 | 6f 72 2e 20 53 69 74 20 |off vect|or. Sit |
|00003ac0| 69 6e 20 61 20 6c 6f 6f | 70 20 64 69 73 70 6c 61 |in a loo|p displa|
|00003ad0| 79 69 6e 67 20 61 20 63 | 6f 75 6e 74 65 72 20 76 |ying a c|ounter v|
|00003ae0| 61 6c 75 65 0a 20 2a 20 | 75 6e 74 69 6c 20 61 6e |alue. * |until an|
|00003af0| 79 20 6b 65 79 20 69 73 | 20 68 69 74 2e 20 54 68 |y key is| hit. Th|
|00003b00| 65 6e 20 72 65 6d 6f 76 | 65 20 74 68 65 20 68 61 |en remov|e the ha|
|00003b10| 6e 64 6c 65 72 20 69 6e | 20 61 20 58 42 52 41 20 |ndler in| a XBRA |
|00003b20| 66 72 69 65 6e 64 6c 79 | 0a 20 2a 20 6d 61 6e 6e |friendly|. * mann|
|00003b30| 65 72 2e 0a 20 2a 0a 20 | 2a 20 20 20 20 20 20 2b |er.. *. |* +|
|00003b40| 2b 6a 72 62 20 20 20 20 | 62 61 6d 6d 69 40 63 61 |+jrb |bammi@ca|
|00003b50| 64 65 6e 63 65 2e 63 6f | 6d 0a 20 2a 2f 0a 23 69 |dence.co|m. */.#i|
|00003b60| 6e 63 6c 75 64 65 20 3c | 73 74 64 64 65 66 2e 68 |nclude <|stddef.h|
|00003b70| 3e 0a 23 69 6e 63 6c 75 | 64 65 20 3c 78 62 72 61 |>.#inclu|de <xbra|
|00003b80| 2e 68 3e 0a 23 69 6e 63 | 6c 75 64 65 20 3c 6f 73 |.h>.#inc|lude <os|
|00003b90| 62 69 6e 64 2e 68 3e 0a | 23 69 6e 63 6c 75 64 65 |bind.h>.|#include|
|00003ba0| 20 3c 73 74 64 69 6f 2e | 68 3e 0a 0a 75 6e 73 69 | <stdio.|h>..unsi|
|00003bb0| 67 6e 65 64 20 73 68 6f | 72 74 20 63 6f 75 6e 74 |gned sho|rt count|
|00003bc0| 65 72 20 3d 20 30 3b 20 | 20 20 20 20 2f 2a 20 63 |er = 0; | /* c|
|00003bd0| 6f 75 6e 74 65 72 20 69 | 6e 63 72 65 6d 65 6e 74 |ounter i|ncrement|
|00003be0| 65 64 20 69 6e 20 68 61 | 6e 64 6c 65 72 20 2a 2f |ed in ha|ndler */|
|00003bf0| 0a 75 6e 73 69 67 6e 65 | 64 20 73 68 6f 72 74 20 |.unsigne|d short |
|00003c00| 64 69 76 69 73 6f 72 20 | 3d 20 35 30 3b 20 20 20 |divisor |= 50; |
|00003c10| 20 2f 2a 20 69 6e 63 72 | 65 6d 65 6e 74 20 63 6f | /* incr|ement co|
|00003c20| 75 6e 74 65 72 20 65 76 | 65 72 79 20 64 69 76 69 |unter ev|ery divi|
|00003c30| 73 6f 72 20 74 69 63 6b | 73 20 2a 2f 0a 76 6f 69 |sor tick|s */.voi|
|00003c40| 64 20 6d 79 5f 68 61 6e | 64 6c 65 72 28 76 6f 69 |d my_han|dler(voi|
|00003c50| 64 29 3b 0a 78 62 72 61 | 5f 73 74 72 75 63 74 20 |d);.xbra|_struct |
|00003c60| 74 69 63 6b 5f 78 62 72 | 61 20 3d 20 5f 58 42 52 |tick_xbr|a = _XBR|
|00003c70| 41 5f 49 4e 49 54 28 6d | 79 5f 68 61 6e 64 6c 65 |A_INIT(m|y_handle|
|00003c80| 72 29 3b 20 2f 2a 20 58 | 42 52 41 20 65 6c 65 6d |r); /* X|BRA elem|
|00003c90| 65 6e 74 20 2a 2f 0a 0a | 23 64 65 66 69 6e 65 20 |ent */..|#define |
|00003ca0| 5f 54 49 4d 45 5f 56 45 | 43 20 20 20 20 20 20 20 |_TIME_VE|C |
|00003cb0| 30 78 31 30 30 0a 0a 2f | 2a 0a 20 2a 20 6f 75 72 |0x100../|*. * our|
|00003cc0| 20 65 78 63 65 70 74 69 | 6f 6e 20 68 61 6e 64 6c | excepti|on handl|
|00003cd0| 65 72 20 0a 20 2a 2f 0a | 76 6f 69 64 20 6d 79 5f |er . */.|void my_|
|00003ce0| 68 61 6e 64 6c 65 72 28 | 76 6f 69 64 29 0a 7b 0a |handler(|void).{.|
|00003cf0| 20 20 20 20 69 66 28 2d | 2d 64 69 76 69 73 6f 72 | if(-|-divisor|
|00003d00| 20 3d 3d 20 30 29 20 0a | 20 20 20 20 7b 0a 20 20 | == 0) .| {. |
|00003d10| 20 20 20 20 20 20 63 6f | 75 6e 74 65 72 2b 2b 3b | co|unter++;|
|00003d20| 20 20 64 69 76 69 73 6f | 72 20 3d 20 35 30 3b 0a | diviso|r = 50;.|
|00003d30| 20 20 20 20 7d 0a 20 20 | 20 20 5f 5f 61 73 6d 5f | }. | __asm_|
|00003d40| 5f 20 76 6f 6c 61 74 69 | 6c 65 0a 20 20 20 20 28 |_ volati|le. (|
|00003d50| 22 20 20 75 6e 6c 6b 20 | 20 20 20 61 36 20 20 20 |" unlk | a6 |
|00003d60| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2f | | /|
|00003d70| 2a 20 63 6c 65 61 6e 20 | 75 70 20 73 74 61 63 6b |* clean |up stack|
|00003d80| 20 66 72 61 6d 65 20 2a | 2f 0a 20 20 20 20 20 20 | frame *|/. |
|00003d90| 20 20 6d 6f 76 6c 20 20 | 20 20 5f 74 69 63 6b 5f | movl | _tick_|
|00003da0| 78 62 72 61 2b 38 2c 20 | 61 30 20 20 20 20 2f 2a |xbra+8, |a0 /*|
|00003db0| 20 6a 75 6d 70 20 74 6f | 20 6e 65 78 74 20 68 61 | jump to| next ha|
|00003dc0| 6e 64 6c 65 72 20 2a 2f | 0a 20 20 20 20 20 20 20 |ndler */|. |
|00003dd0| 20 6a 6d 70 20 20 20 20 | 20 61 30 40 22 29 3b 0a | jmp | a0@");.|
|00003de0| 7d 0a 20 20 20 20 20 20 | 20 20 0a 2f 2a 0a 20 2a |}. | ./*. *|
|00003df0| 20 75 6e 6c 69 6e 6b 20 | 61 20 68 61 6e 64 6c 65 | unlink |a handle|
|00003e00| 72 20 69 6e 20 61 20 78 | 62 72 61 20 66 72 69 65 |r in a x|bra frie|
|00003e10| 6e 64 6c 79 20 6d 61 6e | 6e 65 72 20 66 72 6f 6d |ndly man|ner from|
|00003e20| 20 74 68 65 20 65 78 63 | 20 63 68 61 69 6e 0a 20 | the exc| chain. |
|00003e30| 2a 20 72 65 74 75 72 6e | 73 20 30 20 6f 6e 20 63 |* return|s 0 on c|
|00003e40| 6c 65 61 6e 20 75 6e 6c | 69 6e 6b 2c 20 21 30 20 |lean unl|ink, !0 |
|00003e50| 69 66 20 73 6f 6d 65 74 | 68 69 6e 67 20 69 66 20 |if somet|hing if |
|00003e60| 69 74 20 63 6f 75 6c 64 | 27 6e 74 0a 20 2a 2f 0a |it could|'nt. */.|
|00003e70| 69 6e 74 20 75 6e 6c 69 | 6e 6b 5f 68 61 6e 64 6c |int unli|nk_handl|
|00003e80| 65 72 28 6d 65 2c 20 65 | 78 63 29 0a 78 62 72 61 |er(me, e|xc).xbra|
|00003e90| 5f 73 74 72 75 63 74 20 | 2a 6d 65 3b 0a 69 6e 74 |_struct |*me;.int|
|00003ea0| 20 65 78 63 3b 0a 7b 0a | 20 20 20 20 78 62 72 61 | exc;.{.| xbra|
|00003eb0| 5f 73 74 72 75 63 74 20 | 2a 74 68 69 73 2c 20 2a |_struct |*this, *|
|00003ec0| 70 72 65 76 3b 0a 20 20 | 20 20 6c 6f 6e 67 20 73 |prev;. | long s|
|00003ed0| 61 76 65 5f 73 73 70 3b | 0a 20 20 20 20 0a 20 20 |ave_ssp;|. . |
|00003ee0| 20 20 74 68 69 73 20 3d | 20 28 78 62 72 61 5f 73 | this =| (xbra_s|
|00003ef0| 74 72 75 63 74 20 2a 29 | 20 20 20 20 20 20 2f 2a |truct *)| /*|
|00003f00| 20 67 65 74 20 68 65 61 | 64 20 6f 66 20 63 68 61 | get hea|d of cha|
|00003f10| 69 6e 20 2a 2f 0a 20 20 | 20 20 20 20 20 20 28 28 |in */. | ((|
|00003f20| 75 6e 73 69 67 6e 65 64 | 20 6c 6f 6e 67 29 53 65 |unsigned| long)Se|
|00003f30| 74 65 78 63 28 65 78 63 | 2c 20 2d 31 4c 29 20 2d |texc(exc|, -1L) -|
|00003f40| 20 6f 66 66 73 65 74 6f | 66 28 78 62 72 61 5f 73 | offseto|f(xbra_s|
|00003f50| 74 72 75 63 74 2c 20 6a | 75 6d 70 29 29 3b 0a 20 |truct, j|ump));. |
|00003f60| 20 20 20 69 66 28 74 68 | 69 73 20 3d 3d 20 6d 65 | if(th|is == me|
|00003f70| 29 0a 20 20 20 20 7b 20 | 20 20 2f 2a 20 61 74 20 |). { | /* at |
|00003f80| 74 68 65 20 68 65 61 64 | 2c 20 6a 75 73 74 20 75 |the head|, just u|
|00003f90| 6e 6c 69 6e 6b 20 2a 2f | 0a 20 20 20 20 20 20 20 |nlink */|. |
|00003fa0| 20 53 65 74 65 78 63 28 | 65 78 63 2c 20 6d 65 2d | Setexc(|exc, me-|
|00003fb0| 3e 6e 65 78 74 29 3b 0a | 20 20 20 20 20 20 20 20 |>next);.| |
|00003fc0| 72 65 74 75 72 6e 20 30 | 3b 0a 20 20 20 20 7d 0a |return 0|;. }.|
|00003fd0| 20 20 20 20 2f 2a 20 6f | 74 68 65 72 77 69 73 65 | /* o|therwise|
|00003fe0| 20 66 69 6e 64 20 6d 65 | 20 69 6e 20 74 68 65 20 | find me| in the |
|00003ff0| 63 68 61 69 6e 20 61 6e | 64 20 75 6e 6c 69 6e 6b |chain an|d unlink|
|00004000| 20 2a 2f 0a 20 20 20 20 | 73 61 76 65 5f 73 73 70 | */. |save_ssp|
|00004010| 20 3d 20 53 75 70 65 72 | 28 30 4c 29 3b 0a 20 20 | = Super|(0L);. |
|00004020| 20 20 66 6f 72 28 70 72 | 65 76 20 3d 20 74 68 69 | for(pr|ev = thi|
|00004030| 73 3b 20 74 68 69 73 20 | 26 26 20 28 74 68 69 73 |s; this |&& (this|
|00004040| 20 21 3d 20 6d 65 29 3b | 20 70 72 65 76 20 3d 20 | != me);| prev = |
|00004050| 74 68 69 73 2c 0a 20 20 | 20 20 20 20 20 20 74 68 |this,. | th|
|00004060| 69 73 20 3d 20 28 78 62 | 72 61 5f 73 74 72 75 63 |is = (xb|ra_struc|
|00004070| 74 20 2a 29 28 28 74 68 | 69 73 2d 3e 6e 65 78 74 |t *)((th|is->next|
|00004080| 29 20 3f 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |) ?. | |
|00004090| 20 20 20 20 28 28 28 63 | 68 61 72 20 2a 29 28 74 | (((c|har *)(t|
|000040a0| 68 69 73 2d 3e 6e 65 78 | 74 29 29 20 2d 20 6f 66 |his->nex|t)) - of|
|000040b0| 66 73 65 74 6f 66 28 78 | 62 72 61 5f 73 74 72 75 |fsetof(x|bra_stru|
|000040c0| 63 74 2c 20 6a 75 6d 70 | 29 29 20 3a 20 30 29 29 |ct, jump|)) : 0))|
|000040d0| 0a 20 20 20 20 7b 0a 20 | 20 20 20 20 20 20 20 2f |. {. | /|
|000040e0| 2a 20 76 61 6c 69 64 61 | 74 65 20 74 68 65 20 78 |* valida|te the x|
|000040f0| 62 72 61 20 2a 2f 0a 20 | 20 20 20 20 20 20 20 69 |bra */. | i|
|00004100| 66 28 74 68 69 73 2d 3e | 78 62 72 61 5f 6d 61 67 |f(this->|xbra_mag|
|00004110| 69 63 20 21 3d 20 5f 58 | 42 52 41 5f 4d 41 47 49 |ic != _X|BRA_MAGI|
|00004120| 43 29 20 0a 20 20 20 20 | 20 20 20 20 7b 20 20 20 |C) . | { |
|00004130| 20 20 20 20 2f 2a 20 73 | 68 61 6d 65 20 6f 6e 20 | /* s|hame on |
|00004140| 79 6f 75 20 2a 2f 0a 20 | 20 20 20 20 20 20 20 20 |you */. | |
|00004150| 20 20 20 53 75 70 65 72 | 28 73 61 76 65 5f 73 73 | Super|(save_ss|
|00004160| 70 29 3b 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |p);. | |
|00004170| 53 65 74 65 78 63 28 65 | 78 63 2c 20 6d 65 2d 3e |Setexc(e|xc, me->|
|00004180| 6e 65 78 74 29 3b 20 2f | 2a 20 6e 75 6b 65 20 69 |next); /|* nuke i|
|00004190| 74 2c 20 6f 74 68 65 72 | 77 69 73 65 20 69 74 20 |t, other|wise it |
|000041a0| 6d 61 79 20 63 61 6c 6c | 20 4d 45 20 2a 2f 0a 20 |may call| ME */. |
|000041b0| 20 20 20 20 20 20 20 20 | 20 20 20 72 65 74 75 72 | | retur|
|000041c0| 6e 20 31 3b 20 20 20 20 | 20 20 20 20 20 20 20 20 |n 1; | |
|000041d0| 20 20 2f 2a 20 61 66 74 | 65 72 20 49 20 61 6d 20 | /* aft|er I am |
|000041e0| 64 65 69 6e 73 74 61 6c | 6c 65 64 20 2a 2f 0a 20 |deinstal|led */. |
|000041f0| 20 20 20 20 20 20 20 7d | 0a 20 20 20 20 7d 0a 20 | }|. }. |
|00004200| 20 20 20 0a 20 20 20 20 | 69 66 28 20 28 74 68 69 | . |if( (thi|
|00004210| 73 20 3d 3d 20 6d 65 29 | 20 26 26 20 28 74 68 69 |s == me)| && (thi|
|00004220| 73 2d 3e 67 6e 75 63 5f | 6d 61 67 69 63 20 3d 3d |s->gnuc_|magic ==|
|00004230| 20 5f 47 4e 55 43 5f 4d | 41 47 49 43 29 20 29 0a | _GNUC_M|AGIC) ).|
|00004240| 20 20 20 20 7b 20 20 20 | 2f 2a 20 75 6e 6c 69 6e | { |/* unlin|
|00004250| 6b 20 6d 65 20 66 72 6f | 6d 20 6d 69 64 64 6c 65 |k me fro|m middle|
|00004260| 20 6f 66 20 74 68 65 20 | 63 68 61 69 6e 20 2a 2f | of the |chain */|
|00004270| 0a 20 20 20 20 20 20 20 | 20 70 72 65 76 2d 3e 6e |. | prev->n|
|00004280| 65 78 74 20 3d 20 74 68 | 69 73 2d 3e 6e 65 78 74 |ext = th|is->next|
|00004290| 3b 0a 20 20 20 20 20 20 | 20 20 53 75 70 65 72 28 |;. | Super(|
|000042a0| 73 61 76 65 5f 73 73 70 | 29 3b 0a 20 20 20 20 20 |save_ssp|);. |
|000042b0| 20 20 20 72 65 74 75 72 | 6e 20 30 3b 0a 20 20 20 | retur|n 0;. |
|000042c0| 20 7d 0a 20 20 20 20 2f | 2a 20 77 65 20 61 72 65 | }. /|* we are|
|000042d0| 20 73 63 72 65 77 65 64 | 20 2a 2f 0a 20 20 20 20 | screwed| */. |
|000042e0| 53 75 70 65 72 28 73 61 | 76 65 5f 73 73 70 29 3b |Super(sa|ve_ssp);|
|000042f0| 0a 20 20 20 20 72 65 74 | 75 72 6e 20 32 3b 0a 7d |. ret|urn 2;.}|
|00004300| 0a 0a 69 6e 74 20 6d 61 | 69 6e 28 29 0a 7b 0a 20 |..int ma|in().{. |
|00004310| 20 20 20 63 68 61 72 20 | 6f 75 74 5b 38 5d 3b 0a | char |out[8];.|
|00004320| 20 20 20 20 75 6e 73 69 | 67 6e 65 64 20 73 68 6f | unsi|gned sho|
|00004330| 72 74 20 6c 61 73 74 20 | 3d 20 30 78 66 66 66 66 |rt last |= 0xffff|
|00004340| 3b 0a 0a 20 20 20 20 2f | 2a 20 69 6e 73 74 61 6c |;.. /|* instal|
|00004350| 6c 20 6f 75 72 20 68 61 | 6e 64 6c 65 72 20 2a 2f |l our ha|ndler */|
|00004360| 0a 20 20 20 20 74 69 63 | 6b 5f 78 62 72 61 2e 6e |. tic|k_xbra.n|
|00004370| 65 78 74 20 3d 20 28 78 | 70 74 72 29 20 53 65 74 |ext = (x|ptr) Set|
|00004380| 65 78 63 28 5f 54 49 4d | 45 5f 56 45 43 2c 20 5f |exc(_TIM|E_VEC, _|
|00004390| 58 42 52 41 5f 56 45 43 | 28 74 69 63 6b 5f 78 62 |XBRA_VEC|(tick_xb|
|000043a0| 72 61 29 29 3b 0a 0a 20 | 20 20 20 2f 2a 20 63 6f |ra));.. | /* co|
|000043b0| 6e 74 69 6e 75 6f 75 73 | 6c 79 20 64 69 73 70 6c |ntinuous|ly displ|
|000043c0| 61 79 20 63 6f 75 6e 74 | 65 72 20 75 6e 74 69 6c |ay count|er until|
|000043d0| 20 61 20 6b 65 79 20 69 | 73 20 68 69 74 20 2a 2f | a key i|s hit */|
|000043e0| 0a 20 20 20 20 64 6f 20 | 7b 0a 20 20 20 20 20 20 |. do |{. |
|000043f0| 20 20 69 66 28 6c 61 73 | 74 20 21 3d 20 63 6f 75 | if(las|t != cou|
|00004400| 6e 74 65 72 29 0a 20 20 | 20 20 20 20 20 20 7b 0a |nter). | {.|
|00004410| 20 20 20 20 20 20 20 20 | 20 20 20 20 6c 61 73 74 | | last|
|00004420| 20 3d 20 63 6f 75 6e 74 | 65 72 3b 0a 20 20 20 20 | = count|er;. |
|00004430| 20 20 20 20 20 20 20 20 | 73 70 72 69 6e 74 66 28 | |sprintf(|
|00004440| 6f 75 74 2c 20 22 25 30 | 35 75 5c 72 22 2c 20 6c |out, "%0|5u\r", l|
|00004450| 61 73 74 29 3b 20 2f 2a | 20 64 69 73 70 6c 61 79 |ast); /*| display|
|00004460| 20 63 6f 75 6e 74 65 72 | 20 2a 2f 0a 20 20 20 20 | counter| */. |
|00004470| 20 20 20 20 20 20 20 20 | 43 63 6f 6e 77 73 28 6f | |Cconws(o|
|00004480| 75 74 29 3b 0a 20 20 20 | 20 20 20 20 20 7d 0a 20 |ut);. | }. |
|00004490| 20 20 20 7d 20 77 68 69 | 6c 65 28 20 42 63 6f 6e | } whi|le( Bcon|
|000044a0| 73 74 61 74 28 32 29 20 | 3d 3d 20 30 20 29 3b 0a |stat(2) |== 0 );.|
|000044b0| 0a 20 20 20 20 2f 2a 20 | 72 65 6d 6f 76 65 20 74 |. /* |remove t|
|000044c0| 68 65 20 68 61 6e 64 6c | 65 72 20 2a 2f 0a 20 20 |he handl|er */. |
|000044d0| 20 20 72 65 74 75 72 6e | 20 75 6e 6c 69 6e 6b 5f | return| unlink_|
|000044e0| 68 61 6e 64 6c 65 72 28 | 26 74 69 63 6b 5f 78 62 |handler(|&tick_xb|
|000044f0| 72 61 2c 20 5f 54 49 4d | 45 5f 56 45 43 29 3b 0a |ra, _TIM|E_VEC);.|
|00004500| 7d 0a 5c 65 6e 64 7b 76 | 65 72 62 61 74 69 6d 7d |}.\end{v|erbatim}|
|00004510| 7d 0a 5c 63 6c 65 61 72 | 70 61 67 65 0a 5c 73 65 |}.\clear|page.\se|
|00004520| 63 74 69 6f 6e 7b 47 4e | 55 43 20 78 62 72 61 2e |ction{GN|UC xbra.|
|00004530| 68 7d 0a 7b 5c 66 6f 6f | 74 6e 6f 74 65 73 69 7a |h}.{\foo|tnotesiz|
|00004540| 65 25 0a 5c 62 65 67 69 | 6e 7b 76 65 72 62 61 74 |e%.\begi|n{verbat|
|00004550| 69 6d 7d 0a 23 69 66 6e | 64 65 66 20 5f 58 42 52 |im}.#ifn|def _XBR|
|00004560| 41 5f 48 0a 23 64 65 66 | 69 6e 65 20 5f 58 42 52 |A_H.#def|ine _XBR|
|00004570| 41 5f 48 0a 0a 74 79 70 | 65 64 65 66 20 76 6f 69 |A_H..typ|edef voi|
|00004580| 64 20 28 2a 78 70 74 72 | 29 20 5f 5f 50 52 4f 54 |d (*xptr|) __PROT|
|00004590| 4f 28 28 76 6f 69 64 29 | 29 3b 0a 0a 74 79 70 65 |O((void)|);..type|
|000045a0| 64 65 66 20 73 74 72 75 | 63 74 20 5f 5f 78 62 72 |def stru|ct __xbr|
|000045b0| 61 0a 7b 0a 20 20 6c 6f | 6e 67 20 20 20 20 20 20 |a.{. lo|ng |
|000045c0| 20 20 78 62 72 61 5f 6d | 61 67 69 63 3b 0a 20 20 | xbra_m|agic;. |
|000045d0| 6c 6f 6e 67 20 20 20 20 | 20 20 20 20 67 6e 75 63 |long | gnuc|
|000045e0| 5f 6d 61 67 69 63 3b 0a | 20 20 78 70 74 72 20 20 |_magic;.| xptr |
|000045f0| 20 20 20 20 20 20 6e 65 | 78 74 3b 0a 20 20 73 68 | ne|xt;. sh|
|00004600| 6f 72 74 20 20 20 20 20 | 20 20 20 6a 75 6d 70 3b |ort | jump;|
|00004610| 0a 20 20 76 6f 69 64 20 | 20 20 20 20 20 20 20 28 |. void | (|
|00004620| 2a 74 68 69 73 29 20 5f | 5f 50 52 4f 54 4f 28 28 |*this) _|_PROTO((|
|00004630| 76 6f 69 64 29 29 3b 0a | 7d 20 78 62 72 61 5f 73 |void));.|} xbra_s|
|00004640| 74 72 75 63 74 3b 0a 0a | 23 64 65 66 69 6e 65 20 |truct;..|#define |
|00004650| 5f 58 42 52 41 5f 4d 41 | 47 49 43 20 20 20 20 20 |_XBRA_MA|GIC |
|00004660| 20 20 20 30 78 35 38 34 | 32 35 32 34 31 4c 20 2f | 0x584|25241L /|
|00004670| 2a 20 22 58 42 52 41 22 | 20 2a 2f 0a 23 64 65 66 |* "XBRA"| */.#def|
|00004680| 69 6e 65 20 5f 47 4e 55 | 43 5f 4d 41 47 49 43 20 |ine _GNU|C_MAGIC |
|00004690| 20 20 20 20 20 20 20 30 | 78 34 37 34 45 35 35 34 | 0|x474E554|
|000046a0| 33 4c 20 2f 2a 20 22 47 | 4e 55 43 22 20 2a 2f 0a |3L /* "G|NUC" */.|
|000046b0| 23 64 65 66 69 6e 65 20 | 5f 4a 4d 50 5f 4f 50 43 |#define |_JMP_OPC|
|000046c0| 4f 44 45 20 20 20 20 20 | 20 20 20 30 78 34 45 46 |ODE | 0x4EF|
|000046d0| 39 0a 23 64 65 66 69 6e | 65 20 5f 4a 53 52 5f 4f |9.#defin|e _JSR_O|
|000046e0| 50 43 4f 44 45 20 20 20 | 20 20 20 20 20 30 78 34 |PCODE | 0x4|
|000046f0| 45 42 39 0a 0a 23 64 65 | 66 69 6e 65 20 5f 58 42 |EB9..#de|fine _XB|
|00004700| 52 41 5f 56 45 43 28 78 | 29 20 20 20 20 20 20 20 |RA_VEC(x|) |
|00004710| 20 28 28 76 6f 69 64 20 | 28 2a 29 20 5f 5f 50 52 | ((void |(*) __PR|
|00004720| 4f 54 4f 28 28 76 6f 69 | 64 29 29 29 20 26 28 78 |OTO((voi|d))) &(x|
|00004730| 2e 6a 75 6d 70 29 29 0a | 0a 23 64 65 66 69 6e 65 |.jump)).|.#define|
|00004740| 20 5f 58 42 52 41 5f 49 | 4e 49 54 28 66 6e 29 20 | _XBRA_I|NIT(fn) |
|00004750| 20 7b 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | { | |
|00004760| 20 20 20 20 5c 0a 20 20 | 20 20 20 20 20 20 20 20 | \. | |
|00004770| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004780| 20 5f 58 42 52 41 5f 4d | 41 47 49 43 2c 20 20 20 | _XBRA_M|AGIC, |
|00004790| 20 5c 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | \. | |
|000047a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 5f 47 | | _G|
|000047b0| 4e 55 43 5f 4d 41 47 49 | 43 2c 20 20 20 20 5c 0a |NUC_MAGI|C, \.|
|000047c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000047d0| 20 20 20 20 20 20 20 20 | 20 20 20 28 78 70 74 72 | | (xptr|
|000047e0| 29 20 30 2c 20 20 20 20 | 20 20 20 5c 0a 20 20 20 |) 0, | \. |
|000047f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004800| 20 20 20 20 20 20 20 20 | 5f 4a 4d 50 5f 4f 50 43 | |_JMP_OPC|
|00004810| 4f 44 45 2c 20 20 20 20 | 5c 0a 20 20 20 20 20 20 |ODE, |\. |
|00004820| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004830| 20 20 20 20 20 28 76 6f | 69 64 20 28 2a 29 20 5f | (vo|id (*) _|
|00004840| 5f 50 52 4f 54 4f 28 28 | 76 6f 69 64 29 29 29 20 |_PROTO((|void))) |
|00004850| 66 6e 20 5c 0a 20 20 20 | 20 20 20 20 20 20 20 20 |fn \. | |
|00004860| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 7d 0a 0a | | }..|
|00004870| 23 64 65 66 69 6e 65 20 | 5f 54 52 41 50 5f 56 45 |#define |_TRAP_VE|
|00004880| 43 28 6e 2c 78 29 20 5c | 0a 20 28 28 76 6f 69 64 |C(n,x) \|. ((void|
|00004890| 20 28 2a 29 20 5f 5f 50 | 52 4f 54 4f 28 28 76 6f | (*) __P|ROTO((vo|
|000048a0| 69 64 29 29 29 20 28 28 | 28 6c 6f 6e 67 29 20 6e |id))) ((|(long) n|
|000048b0| 20 3c 3c 20 32 34 29 20 | 7c 20 28 6c 6f 6e 67 29 | << 24) || (long)|
|000048c0| 20 26 28 78 2e 6a 75 6d | 70 29 29 29 0a 0a 23 64 | &(x.jum|p)))..#d|
|000048d0| 65 66 69 6e 65 20 5f 54 | 52 41 50 5f 49 4e 49 54 |efine _T|RAP_INIT|
|000048e0| 28 66 6e 29 20 20 7b 20 | 20 20 20 20 20 20 20 20 |(fn) { | |
|000048f0| 20 20 20 20 20 20 20 20 | 20 5c 0a 20 20 20 20 20 | | \. |
|00004900| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004910| 20 20 20 20 20 20 5f 58 | 42 52 41 5f 4d 41 47 49 | _X|BRA_MAGI|
|00004920| 43 2c 20 20 20 20 5c 0a | 20 20 20 20 20 20 20 20 |C, \.| |
|00004930| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004940| 20 20 20 5f 47 4e 55 43 | 5f 4d 41 47 49 43 2c 20 | _GNUC|_MAGIC, |
|00004950| 20 20 20 5c 0a 20 20 20 | 20 20 20 20 20 20 20 20 | \. | |
|00004960| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004970| 28 78 70 74 72 29 20 30 | 2c 20 20 20 20 20 20 20 |(xptr) 0|, |
|00004980| 5c 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |\. | |
|00004990| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 5f 4a 53 | | _JS|
|000049a0| 52 5f 4f 50 43 4f 44 45 | 2c 20 20 20 20 5c 0a 20 |R_OPCODE|, \. |
|000049b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000049c0| 20 20 20 20 20 20 20 20 | 20 20 28 76 6f 69 64 20 | | (void |
|000049d0| 28 2a 29 20 5f 5f 50 52 | 4f 54 4f 28 28 76 6f 69 |(*) __PR|OTO((voi|
|000049e0| 64 29 29 29 20 66 6e 20 | 5c 0a 20 20 20 20 20 20 |d))) fn |\. |
|000049f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004a00| 20 20 7d 0a 23 65 6e 64 | 69 66 20 2f 2a 20 5f 58 | }.#end|if /* _X|
|00004a10| 42 52 41 5f 48 20 2a 2f | 0a 5c 65 6e 64 7b 76 65 |BRA_H */|.\end{ve|
|00004a20| 72 62 61 74 69 6d 7d 7d | 0a 0a 5c 65 6e 64 7b 64 |rbatim}}|..\end{d|
|00004a30| 6f 63 75 6d 65 6e 74 7d | 0a 0a |ocument}|.. |
+--------+-------------------------+-------------------------+--------+--------+